SCM migration from svn to git
Setup process 0. Install git-svn ;
- Create authors translation program, need to be executable
- cat to_git_name.sh name_map() { svn_name=$1 git_name=$(echo ${svn_name} | sed -e ’s/_/-/’) echo “${git_name} ${svn_name}@worksap.co.jp” } name_map $1
- Setup local repo and fetch master:
- git svn clone –username=an_x https://legion.ariel-networks.com/svn/agn –trunk=/trunk/agn –branches=/branches –tags=/tags –prefix=svn/ –authors-prog=/ariel/to_git_name.sh NOTE: This method is not applicable! Please check $PROJECT_DIR/.git/config to confirm right branches and tags
- Setup new branch: use “neobr” as example
- git svn fetch neobr —authors-prog=/ariel/to_git_name.sh
- git checkout -b neobr svn/neobr #svn is above step settled prefix
- git branch # to check neobr exist or not
- Manually update commits from svn to git
- git svn fetch neobr —authors-prog=/ariel/to_git_name.sh
- git svn rebase
- git push origin neobr
- Reset wrongly updated items: $ git svn reset -r $SVN_REVISION_ID
- Check current local directory status: git svn info
- Commit git-commit to svn: $ git svn dcommit
Update a branch
(1)git svn fetch BR —authors-prog=/…