Git安裝
直接官網(wǎng)下載git for windows
用戶信息配置
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git config --list
Git基本命令
work flow
git clone
git checkout -b branch_name origin/develop
coding...
coding...
git commit -a -m "wa"
git push origin branch_name
merger request...
compare
git pull
auto merge...
or by hand
git push
其他命令
git branch -r # 遠(yuǎn)程分支
git branch -a # 所有分支
git branch -d / -D # 刪除
git pull = git fetch + merge to local
git diff # 尚未保存的與暫存區(qū)的diff
git diff --staged # 已經(jīng)暫存的將要添加到下次提交的內(nèi)容
git log --graph
git log --pretty=format:"%h - %an, %ar : %s"
# 例如,你提交后發(fā)現(xiàn)忘記了暫存某些需要的修改,可以像下面這樣操作:
git commit -m 'initial commit'
git add forgotten_file
git commit --amend