忽略文件提交
.gitignore
檢查gitignore 命令衝突的命令
git check-ignore -v App.class
分支
查看分支:git branch
創建分支:git branch <name>
切換分支:git checkout <name>
創建+切換分支:git checkout -b <name>
合併某分支到當前分支:git merge <name>
刪除分支:git branch -d <name>
用
git
log --graph
命令可以看到分支合併圖。
把當前工作現場“儲藏”起來,等以後恢復現場後繼續工作
git
stash
git stash list
命令查看隱藏的地方
兩種恢復方式
git
stash apply
恢復,但是恢復後,stash內容並不刪除,你需要用git
stash drop
來刪除
另一種方式是用git
stash pop
,恢復的同時把stash內容也刪了
可以多次stash,恢復的時候,先用git
stash list
查看,然後恢復指定的stash,用命令
git stash apply stash@{0}
命令
git push origin <tagname>
可以推送一個本地標籤;命令
git push origin --tags
可以推送全部未推送過的本地標籤;命令
git tag -d <tagname>
可以刪除一個本地標籤;命令
git push origin :refs/tags/<tagname>
可以刪除一個遠程標籤。