In an effort to improve my Git commit messages I’ve decided to employ a commit message template. This starts with a file in my Home directory vi ~/.git-commit-msg-template Three simple lines beginning with # so if I ignore them, so does Git. # What this commit does # Why this commit is being made # […]
git
Init Git Submodules After Clone
With version 1.6.5 of Git and later, you can use: git clone –recursive git://github.com/foo/bar.git cd bar For already cloned repos, or older Git versions, just use: git clone git://github.com/foo/bar.git cd bar git submodule update –init –recursive From SO
Specify Branch for Git Pull
[branch “master”] remote = origin merge = refs/heads/master or $ git config branch.master.remote origin $ git config branch.master.merge refs/heads/master This tells Git 2 things: When you’re on the master branch, the default remote is origin. When using git pull on the master branch, with no remote and branch specified, use the default remote (origin) and merge in […]
DiffMerge, Git and OS X
git config –global diff.tool diffmerge git config –global difftool.diffmerge.cmd ‘diffmerge “$LOCAL” “$REMOTE”‘ git config –global merge.tool diffmerge git config –global mergetool.diffmerge.cmd ‘diffmerge –merge –result=”$MERGED” “$LOCAL” “$(if test -f “$BASE”; then echo “$BASE”; else echo “$LOCAL”; fi)” “$REMOTE”‘ git config –global mergetool.diffmerge.trustExitCode true Now git getdiff is available just as git diff # diff the local file.m against the checked-in version git difftool file.m # diff the local […]
Oh-My-Zsh Git Aliases
g git gst git status gd git diff gl git pull gup git pull –rebase gp git push gd git diff gc git commit -v gc! git commit -v –amend gca git commit -v -a gca! git commit -v -a –amend gco git checkout gcm git checkout master gr git remote grv git remote -v […]
Git Workflow – Lynda/Skoglund
KS git checkout master git pull git fetch git merge origin/master git checkout -b feedback_form git add feedback.html git commit -m “Add customer feedback form” git fetch git push -u origin feedback_form LDC git checkout master git pull git checkout -b feedback_form origin/feedback_form git log git show 84j34df8 git commit -am “Add something else to […]