2017-12-27 70 views
1

私は開発者であり、初めてSVNリポジトリ全体をGITリポジトリに移行しています。 POCとして、私は現在の開発ブランチを移行しました。マイグレーションは歴史とともに成功しました。 問題:GITのSVNコミット履歴 移行の結果:SVNからの現在のdevブランチのすべての履歴が移行されますが、このブランチがSVNで作成された日付から移行されます。 私の期待:すべての個々のファイルの履歴とその完全な履歴と関連するコードの変更。SVNからのすべてのコミット履歴はGITに移行されません

例:私のルートリポジトリは "MyProject"です。 "MyDevRepo-rel-1.0"などのすべてのリリースで個別のコードリポジトリを持っています。リリース1.0以降で作業していた "MyDevRepo-rel-1.0"で作成された "Helloworld.java"というファイルがあります現在のリリースまで、「MyDevRepo-rel-5.0」と言います。 "MyDevRepo-rel-5.0"を移行したとき、HelloWorld.javaファイルの現在のブランチコミット履歴は取得されましたが、リリース1.0では発生しませんでした。

これについて助けてください。

+0

明確な問題文を入力してください。また、SVNとgitの違いを知るためにお招きしたいと思います。 – evolutionxbox

+0

'MyDevRepo-rel-1.0'、' MyDevRepo-rel-5.0'などはMyProjectのサブフォルダですか?それらがサブフォルダである場合、 'Helloworld.java'ファイルはどこにありますか?リビジョンリリース1.0がすでにgit repoに移行されている場合、 'Helloworld.java'ファイルがリビジョンリリース1.0にコミットしていない限り、リビジョンのすべてのファイルを正しく表示する必要があります。 svnログを再確認して、どのリビジョンが 'Helloworld.java'ファイルをコミットしているかを調べることができます。 –

+0

1.MyDevRepo-rel-1.0、MyDevRepo-rel-5.0などはMyProject.2のサブフォルダです.HelloWorld.javaはMyDevRepo-rel1.0で最初に作成されました。 3.すべてのリリースの開発サイクルでは、MyDevRepo-rel-1.0が最初のMydevRepo-rel-5.0であり、5番目のリリースです.HelloWorld.javaは、リリース1.0から5.0までの独自のコミット履歴を持っています。 HelloWorld.javaファイルが5.0から5.0までのすべてのリリースに対して10のコミットを持っているとしましょう。 5.0リポジトリを移行したとき、私は5つのコミット履歴を取得しましたが、私の期待は15コミットのすべての履歴を取得することでした(5.0から5.0までは10まで)。私の期待は正しいのでしょうか、もし何をすべきかを教えてください。 – Venkata

答えて

-1
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. 
関連する問題