TortoiseGit error: "Remote name must not be empty"

TortoiseGit error: "Remote name must not be empty"

当我尝试使用 TortoiseGit 将初始源代码推送到 Bitbucket 时,出现错误:

Remote name must not be empty.

我已经使用 TortoiseGit 很多时间了,即使我从未输入任何 远程名称,也从未遇到过此错误的任何问题。它仅在我尝试推动时发生。我可以承诺就好了。

如何解决?

这表示目前没有为 pushing/fetching 设置或选择任何远程存储库。由于所有提交仅在 git 中是本地的,您只会在 push/pull/fetch.

上注意到这一点

单击 "Remote" 组合框后面的 "Manage" 按钮以设置 bitbucket(请参阅 https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-remote)。之后 "origin" 将出现在组合框中,您可以 push/pull/fetch.

我自己解决了!我没有完全按照教程去做。

由于这是一个新的存储库,我必须先添加 origin 远程名称。如果您使用命令行,这将执行:

git remote add origin https://yourusername@bitbucket.org/yourteam/yourrepo.git

如果您想在 TortoiseGit 中执行此操作,请改为执行此操作:

  1. 单击下拉远程名称选择右侧的管理
  2. 添加远程名称 origin 和 URL https://yourusername@bitbucket.org/yourteam/yourrepo.git
  3. 选择它作为远程名称然后推送!

通过界面完成此操作的其他方法是使用对话框添加原点,如下所示,