The basic use cases for interacting with svn using git. (Based on http://viget.com/extend/effectively-using-git-with-subversion )
|
Checkout standard repository
|
git svn clone -s svn-url local-dir
|
|
Reflect & track remote ignores
|
git svn show-ignore > .gitignore
|
|
Reflect remote ignores
|
git svn show-ignore >> .git/info/exclude
|
|
Add file/stage changes (recursive)
|
git add file
|
|
Remove file
|
git rm [-r] file
|
|
Interactively stage changes
|
git add -i
|
|
Revert unstaged changes
|
git checkout file
|
|
Revert staged changes
|
git reset HEAD file
|
|
Commit staged changes
|
git commit
|
|
Add and commit all changes
|
git commit -a
|
|
Create new branch
|
git branch new-branch [old-branch]
|
|
Move to a branch
|
git checkout branch
|
|
Create and move to new branch
|
git checkout -b new-branch [old-branch]
|
|
List local branches
|
git branch
|
|
List local and remote (svn) branches
|
git branch -a
|
|
Merging a branch to current branch
|
git merge other-branch
|
|
Merge a branch as single commit
|
git merge --squash other-branch
|
|
Apply remote changes to local repo
|
git svn rebase
|
|
Commit changes back to Subversion
|
git svn dcommit
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.