2011年11月23日 星期三

git remote; github

Commands help you manage remotes:

add:
git remote add project git://github.com/user/project.git
This will create "project" pointing to git://githun.com/user/project.git

rename:
git remote rename project test
This renames "project" to "test" in a remote and it's remote-tracking branches

rm:
git remote rm project
This deletes "project" remote and any remote-tracking branches we've fetched.

change url:
git remote set-url example git://github.com/user/test.git
This sets the URL of the remote named "example" to git://github.com/user/test.git


git shortcut

git diff --staged; git diff --cached
0. To diff HEAD and added but not committed files

git format-patch -1 SHA1
0. To patch only this commit

git --abbrev-commit --pretty=oneline
0. To shorten SHA1 number and show only one line of commit logs