git - 重置远程跟踪分支

标签 git

如何将远程跟踪分支的分支指针重置为它之前的提交之一,这样看起来我没有 pull (类似于本地分支的硬重置)?

最佳答案

您可以设置对任何其他提交的引用:

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

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

关于git - 重置远程跟踪分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13954486/

相关文章:

Git merge 工具 : "No files need merging"

git - 恢复已添加但未提交的文件

git - 如何浏览服务器上的 Git 存储库?

git grep 显示绝对路径

git - 使用git与服务器同步文件

混帐 : What is the proper line returns settings for multi-platform development?

wordpress - 轻松移动环境:deploybot,docker还是手动grunt/gulp设置?

git move 正在将文件视为新文件

git - 如何将代码推送到 stash API key 的 Github?

eclipse - 使用 egit 从 eclipse 暂存时如何在 github 中的项目根文件夹下获取 src 文件夹