So my team is currently using an svn repository for our project. There has been another team working in parallel but they are using a git repository. I want to take the other team's code and merge it onto ours. I have already tried a few times but I keep pulling their code without merging, i.e. it just overwrites our files. I have been using the git-svn tool and have found little success and I'm afraid that the increasing number of useless and garbage commits in our svn log isn't going to look good in front of my boss.
These are a few of the obstacles that have been in my way:
- We have a single svn repository with about 10 components inside, where the other team has a repo for each component.
- I've been following an example that uses the -s option, which is short for standard layout (svn common directory structure using trunk/branches/tags) which our svn repo does not have. I have not been able to get this method to work without this option, which leads to all the files getting merged (basically just copied) into an empty directory that I don't care about.
- Preferably, I would not want to keep their entire commit history. I just want a single commit saying that I merged their repo with ours. Or a commit for each of their git repos I have to merge. The same example mentioned in the previous bullet copied the entire commit history which added a ton of commits to our log which my team does not care about.
Here is the example (first answer in this post):
mkdir copy-git-repo
cp -a orig-git-repo/. copy-git-repo/
cd copy-git-repo/
svn mkdir --parents https://svn/url/PROJECT/trunk -m "Trying to merge of of their git repos into our svn"
git svn init https://svn/url/PROJECT -s
git svn fetch
git rebase trunk master
# if there are merge conflicts
git status
# deal with merge conflicts listed
git add .
git rebase --continue
git svn dcommit
Does anyone see a mistake that I've made?