更改了 Git 用户名并且需要 commit/push Xcode 项目
Changed Git username and need to commit/push Xcode project
我不是很熟悉Github。
由于安全问题,我更改了网络客户端上的用户名。
我有一个 Xcode 项目,我在本地提交并推送到远程。
我想推送到同一个遥控器,但不能,因为用户名现在已更改。我如何在 Xcode/terminal 中修改它?
我还想将本地用户名更改为远程用户名。 How/where我可以改变这个吗
我尝试检查了我自己的一个 GitHub 项目(它是 public 并没有那么有趣,但无论如何我都会用它作为示例)。
当我进入命令行并执行 git remote -v
时,我被告知:
machine:Clock-Signal user$ git remote -v
origin https://github.com/TomHarte/Clock-Signal.git (fetch)
origin https://github.com/TomHarte/Clock-Signal.git (push)
假设我将我的用户名更改为 HarteTom,那么我的存储库的新远程位置将变为:
https://github.com/HarteTom/Clock-Signal.git
注意到这两个位置都被命名为 'origin' 来自我可以执行的第一个输出 git remote set-url origin https://github.com/HarteTom/Clock-Signal.git
。我可以用另一个 git remote -v
来证实这一点,现在会说:
machine:Clock-Signal user$ git remote -v
origin https://github.com/HarteTom/Clock-Signal.git (fetch)
origin https://github.com/HarteTom/Clock-Signal.git (push)
我不是很熟悉Github。
由于安全问题,我更改了网络客户端上的用户名。
我有一个 Xcode 项目,我在本地提交并推送到远程。
我想推送到同一个遥控器,但不能,因为用户名现在已更改。我如何在 Xcode/terminal 中修改它?
我还想将本地用户名更改为远程用户名。 How/where我可以改变这个吗
我尝试检查了我自己的一个 GitHub 项目(它是 public 并没有那么有趣,但无论如何我都会用它作为示例)。
当我进入命令行并执行 git remote -v
时,我被告知:
machine:Clock-Signal user$ git remote -v
origin https://github.com/TomHarte/Clock-Signal.git (fetch)
origin https://github.com/TomHarte/Clock-Signal.git (push)
假设我将我的用户名更改为 HarteTom,那么我的存储库的新远程位置将变为:
https://github.com/HarteTom/Clock-Signal.git
注意到这两个位置都被命名为 'origin' 来自我可以执行的第一个输出 git remote set-url origin https://github.com/HarteTom/Clock-Signal.git
。我可以用另一个 git remote -v
来证实这一点,现在会说:
machine:Clock-Signal user$ git remote -v
origin https://github.com/HarteTom/Clock-Signal.git (fetch)
origin https://github.com/HarteTom/Clock-Signal.git (push)