Wednesday, January 25, 2012

Git Reference card

Git create remote branch

To create a local branch
git branch branch_name
To switch/checkout local branch
git checkout branch_name
You can combine above two in one step instead
git checkout -b your_branch
Create remote branch (so that other co-workers/programmers/whoever can pull)
git push -u origin your_branch
Others can pull this by
git checkout origin/your_branch

View diff in GIT

What you will commit
git diff

diff between two branch
git diff master..branch_1
diff since last commit
git diff HEAD
This entry is a note to self for being amnesiac
.

0 comments:

Post a Comment