In our company we used to use SVN. Developers used to keep every branch to retain the history of commits, because it would have been lost when the branch was deleted, even when it was merged to trunk.
About a year ago, thankfully we switched to Git. Most of the migration went smoothly, but on some of our repos the information that a branch was merged is missing. Not for all branches, however. I think this happened when a SVN merge was not done on the root directory but in a subdirectory, which is very messy IMHO.
No we have a couple of old branches hanging around we can not delete because we don't want to lose the commit history. The actual code is merged, but Git does not know about it. Is there a way to add a some kind of merge info to a commit in git history?
My SVN repository looked like this:
Trunk ---[1]---------[3]---------[5]
Branch1 \---[2]---/ /
Branch2 \--------------[4]--/
But the migrated Git repository looks like this:
Master ---[1]---------[3]---------[5]
Branch1 \---[2]---/
Branch2 \--------------[4]---
The merges in the original SVN repository were made in commits 3 and 5. For reasons unknown to me commit 3 is recognized as a merge by Git, while commit 5 is not. I want to know if there is a way to tell Git that commit 5 was a merge commit too.
Yes hopefully you can achieve this with Tagging
however after migration you need to make sure that not further commits are there from git.
from the last commit you can follow the commands like
git tag -a SVN -m "Migration commit"
git push origin --tags
and you can check using the following command,
git tag
you can also checkout to that commit anytime untill the tag is present.