一、恢復git reset後的commitgit
使用git reflog找到要恢復的commit號,再git reset commit-idshell
二、上傳branch/tag到遠程倉庫it
git push where_to_push source_ref:destination_refio
如:git push origin refs/heads/develop:refs/heads/develop鉤子
或簡寫爲:git push origin develop:developgrep
另外git push --follow-tags能夠將commits與附註標籤(annotated)上傳到遠程倉庫,但不包含輕量標籤。腳本
三、刪除遠程倉庫上的branch/tag標籤
能夠上傳一個空內容到遠程:git push origin :tagnameco
也能夠:git push --delete origin tagname遠程
四、指定的系統由號user只用於git操做
grep gitshell /etc/shells || which gitshell >> /etc/shells
usermod -s gitshell user
五、git鉤子
.git/hooks下有一系列範例腳本,用於定義某些動做時執行的腳本。