On my master checkout I can do a git svn info and the url is svn://myrepo.com/trunk
when on my new_feature checkout the svn url is svn://myrepo.com/branches/new_feature.
After running a git merge new_feature on my master checkout the master url is changed to svn://myrepo.com/branches/new_feature. This makes both my master and new_feature pointing to the some place and I can no longer git svn dcommit to trunk.
NOTE: This was working last week, and the only thing I can think of that could be different is that I needed to update the branch to trunk. I ran git merge trunk on my branch. Perhaps it git will no longer let me merge my branch back to trunk now?
I would like to know why this is and how to keep that from happening or fix it after it has happened.
git svn doesn’t make a serious attempt at representing git merges in the svn data model (possibly because it can’t be done properly). The svn branch information is picked up from git log messages; somehow the new_feature appeared first in the log. Following the first merge parent would have been better (edit: git-svn probably did, see below).
Anyway, the recommended way to handle this is not to record merges (using
git merge --squashinstead), or to switch to git completely.Seeing your edit: your merge back into trunk must have been a fast-forward. So git-svn followed the first parent of the first merge it saw, which was the merge of trunk into new_feature, until it found a log message with git-svn metadata. Prevent git from fast-forwarding merges into trunk by using
git merge --no-ff feature_branch.