1
我有GitHub和BitBucket帳戶,但我只使用GitHub。就在幾天前,當我拿到BitBucket回購的客戶時,我決定嘗試一下,並安裝了SourceTree,並在那裏購買了回購,並且一切正常。當我參加我的GitHub回購項目時出現了問題。我所做的更改,並與控制檯做add
和commit
,當我寫這git push
出來:GitHub在做git時更改爲BitBucket
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://[email protected]':
其中xyz
甚至不是我的到位桶
所以我的問題是這是怎麼發生的,我怎麼能恢復該用戶名或共享回購用戶的用戶名推動我的GitHub回購?
你的回購庫中'git remote -v'的輸出是什麼? –
'origin https://[email protected]/xyz/project_name.git(push)' – Norgul
哦,可能是我從服務器上拉出了'.git',指向另一個存儲庫......我可以更改它對我的? – Norgul