Git notes
June 23rd, 2008 by Eric AlbrightNow that I’ve used git for a couple weeks, I thought I’d make a few notes of commands I’ve found helpful.
To make a local branch for development
git checkout -b name_of_new_branch
To commit changes to the local repository (although I usually use the visual gittk for this)
git commit -a
To commit changes back to subversion
git svn dcommit
To uncommit
git reset HEAD~1
To keep a local branch up to date with subversion (use git stash to hide away local uncommitted changes for later)
git svn rebase
To move the master branch up to trunk
git checkout master
git svn rebase
to handle conflicts with merge
git mergetool path_to_file_needing_merge
or
git mergetool -t toolname path_to_file_needing_merge
To remove untracked files (like the temps that get created during a merge resolve)
git clean -n to see what it would do
git clean -f -d (-d if you want to remove untracked directories as well)