来自SVN的所有提交历史记录都没有迁移到GIT
我是一名开发人员,并且第一次将我的整个SVN存储库迁移到GIT存储库。作为一个POC,我已经迁移了当前的开发分支。移民在历史上也取得了成功。 问题:GIT中的SVN提交历史记录 迁移结果:当前SVN的所有分支历史记录都是从SVN迁移过来的,但是从SVN中创建该分支的日期开始。 我的期望:每个单独文件的历史以及完整的历史和相关的代码更改。来自SVN的所有提交历史记录都没有迁移到GIT
例如:我的根存储库是“MyProject”。每个版本都有单独的代码仓库,比如“MyDevRepo-rel-1.0”等等......我有一个文件“Helloworld.java”,它是在自发布1.0以来一直在处理的“MyDevRepo-rel-1.0”中创建的直到目前的版本,说它是“MyDevRepo-rel-5.0”。 现在,当我迁移“MyDevRepo-rel-5.0”时,我只有文件HelloWorld.java的当前分支提交历史记录,但不是从发行版1.0开始的
任何人都可以帮忙。
回答:
Thanks all for responding to my doubts. I am able to resolve this issue and the set of commands follow.
My requirement is : MIGRATE EXISTING SVN repository to GIT with all the commit
history.
md mydirectory
cd mydirectory
git svn init <SVN_ROOT_URL>
git config --global user.name "MY NAME"
git config --global user.email "MY EMAIL"
git config svn.authorsfile authors.txt
git svn fetch
git svn show-ignore >> .gitignore
git remote -v (to check the remote branches)
git remote add origin <MY_GIT_REPO>.git
git add .
git commit -m "migrating svn to git"
git push -u origin master (this will push your local repo to the git server)
git svn rebase (this command will sync the latest changes from svn to the current git repo)
git push (this command pushes all the latest code checked-out code from SVN to GIT).
Mistake I made : I migrated one individual branch and expected all the
commit history right from the inception of every file.
Learnings : If I want all the commit history of every individual file, then
I had to migrate the entire SVN repository from the root. This resolved my
problem.
Please add if there are any missing things.
以上是 来自SVN的所有提交历史记录都没有迁移到GIT 的全部内容, 来源链接: utcz.com/qa/265229.html