Skip to content

Instantly share code, notes, and snippets.

View sysout's full-sized avatar

Xiong Xiong sysout

  • Facebook
  • Menlo Park
View GitHub Profile
# That filters the git log with commits that have at least two parents.
git log --min-parents=2 -p --cc
git help revisions brings up http://git-scm.com/docs/gitrevisions, which describes all the the most common ways to reference commits:
HEAD names the commit on which you based the changes in the working tree.
FETCH_HEAD records the branch which you fetched from a remote repository with your last git fetch invocation.
ORIG_HEAD is created by commands that move your HEAD in a drastic way, to record the position of the HEAD before their operation, so that you can easily change the tip of the branch back to the state before you ran them.
MERGE_HEAD records the commit(s) which you are merging into your branch when you run git merge.
CHERRY_PICK_HEAD records the commit which you are cherry-picking when you run git cherry-pick.
@sysout
sysout / .bash_ps1.sh
Last active August 29, 2015 14:02
my command prompt setup for Mac Rails develpment, it shows git information in prompt and change terminal name
# http://brettterpstra.com/2009/11/17/my-new-favorite-bash-prompt/
# http://bytebaker.com/2012/01/09/show-git-information-in-your-prompt/
function git-dirty() {
st=$(git status 2>/dev/null | tail -n 1)
if [[ $st != "nothing to commit, working directory clean" ]]
then
echo "*"
fi
@sysout
sysout / 0_reuse_code.js
Created June 1, 2014 05:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console