Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2016, 08:26:39 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Git: converting svn repo & stuff  (Read 2708 times)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Git: converting svn repo & stuff
« on: July 25, 2010, 05:56:08 PM »
OK, so I've pretty much decided to move from subversion to Git for source control needs. Obviously I'd like my old version history to be ported over from the svn repos, and I've pretty much got that nailed (although there's some quirks to work out, because some of the first stuff I put under version control didn't follow a standard layout).

The tricky part has to do with fSekrit. Eventually, I want to open-source it, but I don't want the full version history to be available to everybody (for instance there's some ugly code in the early versions, swearing in comments, hardcoded passphrases for testing purposes, ...). So, the question goes: is it possible to do a Git setup with two repositories: one with full version history, the other with the "public" version, and the ability to push commits to both repositories? Or will I have to accept that the "historic" repository as a  read-only archive, only pushing changes to the "live" publicly available one?
- carpe noctem

parkint

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 119
  • It's bad luck to be superstitious
    • View Profile
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #1 on: July 25, 2010, 08:09:00 PM »
There are many things about git that I am still learning (disclaimer: I am NOT an expert).
I believe the solution to your problem would be to set up a branch that is 'private'; only available to you.

Hopefully, someone with more experience will chime in here (and provide an example).

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #2 on: July 25, 2010, 08:39:11 PM »
Hm, *scratches beard*.

I know I can set the locations a specific branch push to... so, the idea would be importing the svn repo, and having that push to my private repo. Then, branch off the latest revision to a "public" branch, which would push both to my private repo and a public one; this should keep version history just fine, and keep everything in my private repository.

However, since the public branch would be based off the private one, would pushing the public branch cause all the prior revisions to end up in the public repo .git data?
- carpe noctem

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,725
    • View Profile
    • The Blog of Deozaan
    • Read more about this member.
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #3 on: July 25, 2010, 08:56:38 PM »
I don't know how to do it, but I know it can be done in Mercurial. Not that that helps or anything. . .  :D


ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 409
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #4 on: July 28, 2010, 07:33:53 AM »
you might rebase -i to rewrite you public branch, usually people do this before pushing in public to clean up the mess. It's might not be super easy to merge back changes from the public branch if other people do changes though.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #5 on: July 28, 2010, 07:35:46 AM »
Well, the idea is that development will only continue in the public/new branch, not the private/old one - but I'd still like file history from the public/new branch to track back to the private/old one... if possible, without the public/new repo containing the private data. That, or having the two branches entirely separate, but changes going to both the public and private branches.
- carpe noctem

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 409
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: Git: converting svn repo & stuff
« Reply #6 on: July 28, 2010, 08:48:40 AM »
After looking at it a little bit, it seems that git history must always be complete, there is no way to push half of a branch or have a partial repo (except shallow clones but they have limitation, that doesn't make them suitables as repository ) . But you may cheat by using grafts to stitch your history : http://bugsquash.blo...g-git-histories.html . If I remember correctly grafts only exists on your local clone and can't be pushed, it might be what you're looking for.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript
« Last Edit: July 28, 2010, 09:00:45 AM by ecaradec »