来自:http://blog.jobbole.com/53573/
git clone https:
//github
.com
/git/git
git config --global user.name
"your_username"
git config --global user.email [email protected]
git config --global push.default simple
cd
~
/workspace/my_site/
cd
c:\workspace\my_site
git init
git add .
git add my_file, my_other_file
git commit -m
"initial commit"
git status
git checkout -b new_feature
git branch new_featuregit checkout new_feature
git branch
git add .git commit -m
"adds my new feature"
git checkout master
git merge new_feature
git add .git commit -m
"feature to be discarded"
git checkout master
git branch -d new_feature
git branch -D new_feature
git log
commit ca82a6dff817ec66f44342007202690a93763949Author: your_username [email protected]: Mon Nov 4 12:52:11 2013 -0700 changes the frontpage layout
commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7Author: your_username [email protected]: Mon Nov 4 11:40:33 2013 -0700 adds my new feature
commit a11bef06a3f659402fe7563abf99ad00de2209e6Author: your_username [email protected]: Mon Nov 4 10:37:28 2013 -0700 initial commit
git checkout 085bb3bcb
git checkout -b my_previous_version 085bb3bcb
git remote add origin https:
//your_username
@bitbucket.org
/your_username/name_of_remote_repository
.git
git push origin master
git clone https:
//your_username
@bitbucket.org
/your_username/name_of_remote_repository
.git
git pull origin master
git config --global
alias
.c
'commit -m'
git config --global
alias
.c
'commit -m'
git config --global
alias
.co
'checkout'
git config --global
alias
.cob
'checkout -b'
git config --global
alias
.br
'branch'
git config --global
alias
.m
'merge'
git config --global
alias
.a
'add .'
git config --global
alias
.s
'status'
git config --global
alias
.dbr
'branch -d'