1

Do you have advice on how one could work on a local branch while doing SVN development? I'm working on a project where I can't have a branch in the central repository, but I'd like to be able to merge the contents from trunk every now and then.

Many website recommend using git, but I'm not so used to git, and I'm not really used to that. Another possibility would be to work on a clean checkout, and never commit; but that would mean duplicating many unmodified files.

Any idea regarding local branches in svn?
Thanks!

Clément
  • 12,299
  • 15
  • 75
  • 115

4 Answers4

4

SVN is centralised and thus it doesn't know local branches.

KingCrunch
  • 128,817
  • 21
  • 151
  • 173
  • +1 best way is switching to a DVCS. Mercurial (hg) has similar commandline interface like SVN; git has excellent support; but there are more - Bazaar etc. – Petr Kozelka Aug 22 '11 at 21:58
1

Tis time to learn git. Try git-svn. (Or you could use another SVN-DVCS bridge)

alternative
  • 12,703
  • 5
  • 41
  • 41
  • git-svn is not the solution if svn is used directly by one or more person. Read here: http://stackoverflow.com/questions/7126640/how-to-use-git-svn-properly-svn-ers-checkout-svnrepo-and-git-ers-clone-gitrepo – Petr Kozelka Aug 22 '11 at 21:55
  • 1
    @Petr No, it only doesn't work if thats the exact way that you want to do it. The answer provided shows that git-svn works. Did you not read your own answer? – alternative Aug 22 '11 at 23:30
  • sure, and now again, but I am still missing your point... perhaps I keep overlooking something; can you be more concrete ? – Petr Kozelka Aug 23 '11 at 00:14
  • @Petr Kozelka - Well, you can't just have a mirror that automatically syncs and people pull and push to that mirror. You want the git users to use git-svn clone to get a git repo from the svn repo and then git svn dcommit back up. – alternative Aug 23 '11 at 12:18
  • you are right, that works - as long as git users are fast enough with 'dcommitting' and frequent enough with 'svn pulling' - which is the conclussion there. But, maybe this thread goes in the wrong direction - assuming that @Clement wants to use svn cli; `git-svn` provides him git cli on top of svn repo, but he probably wants svn cli on top of git repo; a tool which might be called `svn-git` if it existed ;) – Petr Kozelka Aug 23 '11 at 14:42
1

This workflow in SVN involves you having a second SVN repository where you work.

You move changes to and from the main repository using patches.

It is less than ideal these days.

Tis time to learn Hg. ;)

sylvanaar
  • 8,096
  • 37
  • 59
0

A less than optimal solution, which doesn't involve git, is to make changes to a fresh local checkout, without committing them, and consider this checkout as a local branch. One can then merge from trunk through svn update, and commit to trunk through svn commit when their work on the branch is completed.

This solution doesn't let one keep a history of the branch, though.

Clément
  • 12,299
  • 15
  • 75
  • 115