vcs/git

SVN과 Git 동기화

C/H 2021. 12. 16. 08:07

svn-authors.txt 생성

  username@gmail.com = user-name <username@domain.com>
  username = user-name <username@domain.com>
  (no author) = user-name <username@domain.com>

원격 SVN을 로컬 Git에 복제

  # -s is /turnk
  git svn clone -s https://svntime.googlecode.com/svn/ svntime -A svn-authors.txt --prefix=origin/
  # 개별 서브 프로젝트 폴더
  git svn clone https://svntime.googlecode.com/svn/trunk/sub-project/ sub-project -A svn-authors.txt

로컬 Git을 원격 Git으로 푸시

  # 원격 저장소 생성 후
  git remote add origin https://github.com/soundasleep/svntime.git
  git push origin master

로컬 변경, Git 및 SVN 모두에 커밋

  # 파일 수정 후,
  git add -A && git commit #로컬 Git에 커밋합니다. 
  git push #원격 Git에 푸시합니다. 
  git svn dcommit #원격 SVN에 커밋합니다. 
  git branch --set-upstream-to=origin/master master #원격 Git을 원격 원본으로 설정합니다.

원격 SVN 변경 사항을 로컬 Git에 병합

  git svn rebase -A ../svn-authors.txt
  git push

원격 Git 변경 사항을 SVN으로 병합

  git pull
  git svn rebase -A svn-authors.txt
  git svn dcommit

git svn rebase: Unknown option: strategy-option

git svn rebase: 알 수 없는 옵션: 전략 옵션
행운을 빕니다.

반응형

'vcs > git' 카테고리의 다른 글

Remove file in All Commits  (0) 2021.12.16
github.com 프로젝트 참여 - 정리 메모  (0) 2020.02.13
비트버킷 저장소 크기 줄이기  (0) 2020.02.03
git reset, 복원  (0) 2019.07.19
github.com 탈퇴, 재가입  (0) 2019.02.21