1、恢复git reset后的commit
使用git reflog找到要恢复的commit号,再git reset commit-id
2、上传branch/tag到远程仓库
git push where_to_push source_ref:destination_ref
如:git push origin refs/heads/develop:refs/heads/develop
或简写为:git push origin develop:develop
另外git push --follow-tags可以将commits与附注标签(annotated)上传到远程仓库,但不包含轻量标签。
3、删除远程仓库上的branch/tag
可以上传一个空内容到远程:git push origin :tagname
也可以:git push --delete origin tagname
4、指定的系统由号user只用于git操作
grep gitshell /etc/shells || which gitshell >> /etc/shells
usermod -s gitshell user
5、git钩子
.git/hooks下有一系列范例脚本,用于定义某些动作时执行的脚本。
===================================================
其它有用的命令:
http://os.51cto.com/art/201908/600913.htm
git log --graph
git reflog