本文介绍了是否可以在 vscode 中 git push --force ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio Code 中,是否可以执行 git push --force <repo><branch> 以某种方式?

From within Visual Studio Code, is it possible to do a git push --force <repo> <branch> in some way?

推荐答案

自 1.35(2019 年 5 月)起,前提是 Settings >扩展 >git >设置了 Allow Force Push,在 Git 菜单中也可以看到 force push 选项:

Since 1.35 (May 2019), provided that Settings > Extensions > Git > Allow Force Push is set, the force push option is also visible in the Git menu:

=>

注意:您需要重新启动 VSCode(或至少重新加载 (VSCode) 窗口")才能看到该新选项.

Note: You need to restart VSCode (or at least "Reload (VSCode) windows") in order to see that new option.

参见 issue 62020,以 PR 62021.

CletusW 所述,在 评论:

注意默认情况下,这使用更安全的 --force-with-lease 选项,也可以在 Settings > 中配置.扩展 >Git,往底部

我在 "git push --force 中详细介绍了 --force-with-lease-with-lease vs. --force".

I detailed --force-with-lease in "git push --force-with-lease vs. --force".

这篇关于是否可以在 vscode 中 git push --force ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:44