是否可以在 vscode 中 git push --force ? [英] Is it possible to git push --force in vscode?
问题描述
在 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.
注意默认情况下,这使用更安全的 --force-with-lease
选项,也可以在 Settings > 中配置.扩展 >Git
,往底部
Note also by default this uses the safer
--force-with-lease
option, also configurable inSettings > Extensions > Git
, toward the bottom
我在 "git push --force 中详细介绍了
vs. --force-with-lease
-with-lease--force
".
I detailed --force-with-lease
in "git push --force-with-lease
vs. --force
".
这篇关于是否可以在 vscode 中 git push --force ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!