-
Create repository
- git svn clone -s <svn-url> <local-dir>
-
Update
- git svn fetch
- git svn rebase
-
Branching
- git branch -a
- git branch -r
- git checkout -b <new_branch> <base_branch>
- git checkout <working_branch>
-
svn branching
- git checkout <branch-base>
- git svn branch -m "message" <new branch>
- git branch -r -d <branch-to-be-deleted>
-
Temporary changes
- git stash
- git stash apply <index>
-
Undo changes
- git reset --hard
- git checkout <checkin-branch> <file to be restored>
-
Local commit
- git commit -a
- git commit -a --amend (merge into previous commit)
- git rebase -i HEAD~<num>
1. pick the first one
2. change others to be "squash"
3. edit log in another window
-
Merging
- git diff <checkin-branch> <working-branch>
- git checkout <checkin-branch>
- git merge <working_branch> --squash
- only merge a target commit: cherry/cherry-pick
-
Publish to SVN
- git svn rebase
- git svn info
- git svn dcommit -n
- git diff-tree <> -u
- git svn dcommit -e
- Check changes first
- Get remote changes
-
reviewboard (post-review)
- post-review [-r <review-id>] --username=zhouh1 --password=password
- --guess-description --guess-summary (reuse git commit log)
- --parent=<remote-branch> (generate svn diff to upload)
- -n (to check changes)
-
References
- Github Learning
- Git casts