GitHub 在执行 git 推送时更改为 BitBucket
GitHub changed to BitBucket when doing git push
我有 GitHub 和 BitBucket 两个帐户,但我只使用 GitHub 一个。就在几天前,当我得到带有 BitBucket 存储库的客户端时,我决定尝试一下并安装了 SourceTree,在那里拉了一个存储库,一切正常。当我继续我的 GitHub 存储库中的项目时出现问题。我进行了更改,并使用控制台进行了 add
和 commit
,当我编写 git push
时,结果如下:
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
所以我想我会 运行 git config --global push.default matching
命令然后再试一次。之后我收到一条消息说:
Password for 'https://xyz@bitbucket.org':
其中 xyz
甚至不是我的用户名或 BitBucket 上共享回购用户的用户名
所以我的问题是这是怎么发生的,我怎样才能恢复它以推动我的 GitHub 回购?
您在 OP 的评论中提到了 git remote -v
输出:
$ git remote -v
origin https://xyz@bitbucket.org/xyz/project_name.git (push)
git remote -v
链接到您的 BitBucket 存储库。您需要 change/set origin
和 GitHub URL.
$ git remote set-url origin <github-repo-url>
# make sure 'origin' is updated
$ git remote -v
我有 GitHub 和 BitBucket 两个帐户,但我只使用 GitHub 一个。就在几天前,当我得到带有 BitBucket 存储库的客户端时,我决定尝试一下并安装了 SourceTree,在那里拉了一个存储库,一切正常。当我继续我的 GitHub 存储库中的项目时出现问题。我进行了更改,并使用控制台进行了 add
和 commit
,当我编写 git push
时,结果如下:
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
所以我想我会 运行 git config --global push.default matching
命令然后再试一次。之后我收到一条消息说:
Password for 'https://xyz@bitbucket.org':
其中 xyz
甚至不是我的用户名或 BitBucket 上共享回购用户的用户名
所以我的问题是这是怎么发生的,我怎样才能恢复它以推动我的 GitHub 回购?
您在 OP 的评论中提到了 git remote -v
输出:
$ git remote -v
origin https://xyz@bitbucket.org/xyz/project_name.git (push)
git remote -v
链接到您的 BitBucket 存储库。您需要 change/set origin
和 GitHub URL.
$ git remote set-url origin <github-repo-url>
# make sure 'origin' is updated
$ git remote -v