git add
將項目放到緩存區(qū)域
git branch
列出本地已經(jīng)存在的分支惹悄,當前分支前面‘*’標記
git branch -a
列出所有的分支
git branch dev
創(chuàng)建本地dev分支,并停留在當前master分支上
git branch -d dev
刪除本地 dev分支
git branch -vv
可以查看本地分支對應的遠程分支
git commit -m 'now test
提交到數(shù)據(jù)庫
git checkout -- filename
放棄單個文件的修改
git checkout .
放棄當前目錄下的修改
git checkout master
切換到master分支
git checkout -b master
創(chuàng)建并切換分支
git checkout tagName
回滾到某次標簽
git checkout <commitID> <filename>
撤銷指定文件到指定版本
git diff
查看文件更改差異
git fetch [remote-name]
git fetch master
拉取遠程倉庫 并獲取分支
git help config
獲取conif手冊文檔
git remote
列出遠程的分支
git reset
git reset HEAD CONTRIBUTING.md
將暫存區(qū)的文件取消
git remote add pb https://github.com/paulboone/ticgit
git remote add <shortname> <url>
添加遠程倉庫
git remote show origin
獲取遠程分支更多詳細信息
git remote rename pb pbtest
遠程倉庫重命名
git remote rm pb
刪除遠程倉庫
git log
查看提交記錄
git log -p
查看每次提交記錄的差異性
git merge test
test 為修改分支合并到主分支
git push origin test:master
git push origin test:test
提交本地test分支作為遠程的master分支
刪除遠程分支
git push origin --delete xiaohei
git revert commitID
找到要回滾的commitID
git status
查看文件狀態(tài)
git show comminId
查看某次的文件修改信息
git tag -a v1.0
記錄一個版本標簽
git tag
查看標簽