Git權威指南 書摘


##
$ git add welcome.txt
warning: LF will be replaced by CRLF in welcome.txt.
The file will have its original line endings in your working directory.git

##
git config --system alias.co chectout日誌

#顯示版本庫.git目錄所在的位置
git rev-parse --git-dirit

#相對於工做區根木子的相對目錄
git rev-parse --show-prefixast

#顯示回根目錄
git rev-parse --show-cdup配置

#查看配置文件,優先級從高到低
git config -e 版本庫級別
git config -e --global 全局
git config -e --system 系統file


# allow-empty容許執行空白提交
git commit --allow-empty -m ''配置文件

--amend
--reset-authordi

#精簡格式日誌
git log --pretty=oneline文件

#精簡格式狀態
git status -s
MM welcome.txt
第一個M 暫存區與版本庫的比較
第二個M 工做區與暫存區的比較
同樣就爲空auth


#撤銷暫存區還沒有提交的修改
git reset HEAD <file>
#撤銷工做區還沒有提交的修改
git checkout -- <file>
#撤銷 用版本庫覆蓋暫存區和工做區,
git checkout HEAD <file>

 

git diff 工做區與暫存區比較
git diff HEAD|master 工做區與版本庫區比較
git diff --cached [HEAD]|--staged

 

git ls-files 查看暫存區文件

相關文章
相關標籤/搜索