svn to git 마이그레이션#
1
2
| git svn clone --stdlayout --no-metadata -A users.txt svn://example.com/repository/projectname
cd projectname
|
아래 users.txt 만드는건데 perl 이 없어서 그런지.. 안되네요… ㅠ
svn log ^/ --xml | grep -P "^<author" | sort -u | \ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
ignore file처리#
1
| git svn show-ignore -i trunk > .gitignore
|
remote git 지정#
1
| git remote add origin git@git.example.com:group/projectname.git
|
1
| git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
|
branches 처리#
1
| git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
|
push한다.#
1
2
| git push origin --all
git push origin --tags
|
revert local commit#
1
| git reset —hard remotes/origin/HEAD
|
backup#
1
| sudo gitlab-rake gitlab:backup:create
|
restore (가장 최근꺼 복원)#
1
| sudo gitlab-rake gitlab:backup:restore
|
restore OPTION (아래 지정한 타임스탬프로 복원시켜준다는건가.. 안해봄..)
BACKUP=timestamp_of_backup (required if more than one backup exists)