2017-04-14 102 views
1

我有GitHub和BitBucket帐户,但我只使用GitHub。就在几天前,当我拿到BitBucket回购的客户时,我决定尝试一下,并安装了SourceTree,并在那里购买了回购,并且一切正常。当我参加我的GitHub回购项目时出现了问题。我所做的更改,并与控制台做addcommit,当我写这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回购?

+0

你的回购库中'git remote -v'的输出是什么? –

+0

'origin https://[email protected]/xyz/project_name.git(push)' – Norgul

+0

哦,可能是我从服务器上拉出了'.git',指向另一个存储库......我可以更改它对我的? – Norgul

回答

2

您提到在OP的评论git remote -v输出:

$ git的远程-v
起源https://[email protected]/xyz/project_name.git(推)

git remote -v链接到您的到位桶库。您需要使用GitHub URL更改/设置origin

$ git remote set-url origin <github-repo-url> 

# make sure 'origin' is updated 
$ git remote -v 
相关问题