更改用户名以推送到 atlassian stash - update-server-info?

Changed username to push with to atlassian stash - update-server-info?

我已经从 Atlassian Stash 签出一个存储库。推回时,我需要使用另一个用户名。我运行

git config remote.origin.url new_user@my.host.com:either/branch/or/path

更改远程源,但在输入 "git push" 后我收到消息“/info/refs 未找到:您是否 运行 git update-server-info on服务器?”

我认为我可以 运行 在 Stash 上执行命令。那么如何重新开启推送呢?

您可以使用单独的 URL 来获取(拉取)和推送。

git remote origin --set-url http://fetchurl
git remote origin --set-url --push https://user@pushurl

问题是您正在尝试更改具有其他影响的远程名称(例如 refs/remotes/ 下的目录)