2017-12-27 96 views
1

저는 개발자이며 처음으로 전체 SVN 리포지토리를 GIT 리포지토리로 마이그레이션하고 있습니다. POC로서 현재 개발 지점을 마이그레이션했습니다. 이력 또한 성공적으로 이관되었습니다. 문제점 : GIT의 SVN 커밋 내역 마이그레이션 결과 : SVN에서 현재 dev 브랜치의 모든 내역이 마이그레이션되지만이 분기가 SVN에서 작성된 날짜부터 마이그레이션됩니다. My Expectation : 모든 개별 파일의 기록과 전체 기록 및 관련 코드가 변경되었습니다.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까지 5까지)을 모두 얻는 것이 었습니다. 내 기대가 맞는지, 그렇지 않다면 무엇을해야하는지 제안하십시오. – 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.