如何更改github存储库的终端shell中的路径?

时间:2015-02-15 20:13:23

标签: git configuration

我是第一次学习,不能推向GitHub。

路径不正确: 它是:https://github/com/TedLaskaris/test-repo.git/
如何将其更改为:https://github.com/TedLaskaris/test-repo.git/

我不知道“/”是如何到达那里的 我不知道如何将其更改为“.

1 个答案:

答案 0 :(得分:1)

您可以使用git remote set-url更改它:

git remote set-url origin https://TedLaskaris@github.com/TedLaskaris/test-repo

(我更喜欢添加TedLaskaris@部分,以避免在推送时输入用户名

对于第二条错误消息(Updates were rejected because the tip of your current branch is behind),我建议使用git pull --rebase,以便在更新的upstream/master之上重新定位您的本地提交。
例如,请参阅“Failed to push some refs when pushing feature branch” (因为你是现在唯一一个推送你的GitHub仓库的人,所以可以改变基础)

https://www.atlassian.com/pt/git/workflows/pageSections/00/contentFullWidth/0/tabs/00/pageSections/05/contentFullWidth/00/content_files/file1/document/git-workflow-svn-6.png

请参阅Atlassian文章“Mary tries to publish her feature”的“Centralized Workflow”部分。

相关问题