Git 设置默认推送目标
如何设置推入式Visual Studio代码的默认目标?我目前配置了两个目标(github和azure),希望将菜单中的“推送”操作设置为两个目标之一。不确定是否在VSC中,但可以从命令行进行<代码>git推送-u。远程可能是GitHub或azure。我会尝试在项目配置中设置默认远程。也许,VSC使用它来知道推到哪里 您可以按如下方式进行操作:Git 设置默认推送目标,git,visual-studio-code,Git,Visual Studio Code,如何设置推入式Visual Studio代码的默认目标?我目前配置了两个目标(github和azure),希望将菜单中的“推送”操作设置为两个目标之一。不确定是否在VSC中,但可以从命令行进行git推送-u。远程可能是GitHub或azure。我会尝试在项目配置中设置默认远程。也许,VSC使用它来知道推到哪里 您可以按如下方式进行操作: git config remote.pushDefault nameOfYourRemote 从mangit-config: 它允许您仍然使用origin,但
git config remote.pushDefault nameOfYourRemote
从mangit-config
:
它允许您仍然使用
origin
,但也可以使用其他遥控器,其中一个遥控器是默认遥控器,而不是origin
Got的可能副本,但最重要的是如何告诉VSC哪个目标应该是我的默认遥控器目标。
remote.pushDefault
The remote to push to by default. Overrides branch.<name>.remote for all branches, and is overridden by branch.<name>.pushRemote for specific
branches.
branch.<name>.remote
When on branch <name>, it tells git fetch and git push which remote to fetch from/push to. The remote to push to may be overridden with
remote.pushDefault (for all branches). The remote to push to, for the current branch, may be further overridden by branch.<name>.pushRemote. If
no remote is configured, or if you are not on any branch, it defaults to origin for fetching and remote.pushDefault for pushing. Additionally,
. (a period) is the current local repository (a dot-repository), see branch.<name>.merge's final note below.