git版本管理

冲击年薪50W,助你进阶Python工程师>>> hot3.png

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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值