git版本管理

一、恢复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下有一系列范例脚本,用于定义某些动做时执行的脚本。

相关文章
相关标签/搜索