如何从远程分支永久删除少量提交 [英] How to permanently remove few commits from remote branch

查看:97
本文介绍了如何从远程分支永久删除少量提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



但是如何从远程分支永久删除少量提交?


<您的本地分支,您 git push - 强制修改本地分支到远程。 (其他解决方案),涉及删除远程分支,并重新推送它)



SO答案说明了这样的命令的危险性,特别是当人们依赖远程历史记录来获得本地回购时。 $ b您需要做好准备,向人们指出从UPSTREAM重新启动时恢复 git rebase 部分页面


I know that's rewriting of history which is bad yada yada.

But how to permanently remove few commits from remote branch?

解决方案

You 'git reset' your local branch, and you git push --force your revised local branch to the remote. (other solution here, involving deleting the remote branch, and re-pushing it)

This SO answer illustrates the danger of such a command, especially if people depends on the remote history for their own local repos.
You need to be prepared to point out people to the RECOVERING FROM UPSTREAM REBASE section of the git rebase man page

这篇关于如何从远程分支永久删除少量提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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