重置远程追踪分支 [英] Reset remote tracked branch

查看:96
本文介绍了重置远程追踪分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将远程追踪分支的分支指针重置为其以前的任何一个提交,因此它看起来像我没有拉(类似于为本地分支重置硬件)?

 <$ c $ 

c> git update-ref refs / remotes / origin / master< commit-sha1或tag>

这将使远程分支 origin / master 指向你指定的提交。


How can I reset the branch pointer of a remote tracked branch to one of its previous commits, so it looks like I didn't pulled (something similar like reset hard for local branches)?

解决方案

You can set the reference to any other commit with:

git update-ref refs/remotes/origin/master <commit-sha1 or tag>

This will make remote branch origin/master point to the commit you specified.

这篇关于重置远程追踪分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆