0

We have a central svn repository and are starting to have people use git locally to manage work items.

When I first set up my local git repository, I set ignore-path to ignore trunk so I could just work on one branch. My coworker did not ignore trunk. This was fine until we started to use a third bare repository to push/pull branches to each other.

When I pull their git branch, it treated trunk as an add and now its a mess.

When I run git svn I now do want it to sync the trunk. How do I re-add/unignore trunk from my local repository?

Kenoyer130
  • 6,874
  • 9
  • 51
  • 73

1 Answers1

1

When you use git-svn to access an svn repository, the best way is to only use the subversion repo to share code¹.

When I run git svn I now do want it to sync the trunk. How do I re-add/unignore trunk from my local repository?

When you run git svn fetch, the new svn revisions of your branch should be imported.

When I pull their git branch, it treated trunk as an add and now its a mess.

Now that you already have shared git revisions, you have to use git rebase --interactive and git cherry-pick to linearize the history, and push it into subversion with git svn dcommit.


¹ Thomas Ferris Nicolaisen and Kris Brown described in detail what you have to do when you want to exchange code with an shared svn mirror.

Rudi
  • 19,366
  • 3
  • 55
  • 77
  • I think since I don't have trunk it was easier to just start with a fresh git locally. If you are missing a branch it seems you can just do a git reset to the revision before the branch was added and then git svn fetch -rxxxx . Besides this issue we have had great success using local gits to share code. – Kenoyer130 Dec 06 '11 at 12:32