git的配置:
配置用戶名和郵箱
$ git config --global user.name "xuhaiyan"
$ git config --global user.email "haiyan.xu.vip@gmail.com"
生成ssh key
$ ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”
- git reset HEAD <file> 來取消緩存區的修改。
不添加<file>參數,撤銷所有緩存區的修改。
2.git子庫操作
Paste_Image.png
4.git diff+commit碼,比較commit碼和當前版本不同的地方
5.git revert -n head反轉最近一次提交:將當前版本變為最后一次提交的前一個版本,處于暫存不提交狀態.
6.git remote update origin --prune更新遠程分支表
7.git config --global core.quotepath false解決不識別中文路徑的問題
8.刪除遠程分支和tag
在Git v1.7.0 之后,可以使用這種語法刪除遠程分支:
$ git push origin --delete <branchName>
刪除tag這么用:
git push origin --delete tag <tagname>
9.修改最近提交說明:
git commit --amend 回車