Git推入第二个账户

时间:2017-04-27 03:41:12

标签: git macos github

我的情况是我有两个GitHub帐户(一个是我的主帐户,另一个基本上用于在两台不同的计算机之间共享信息)。 我正在尝试将我的工作推到我的辅助帐户并创建一个新的origin2通过终端推入该帐户但它没有通过。任何和所有的建议将不胜感激。回购品名称是实际账户中的回购。

Jacobs-MacBook-Pro:bloc-jams JYUN$ git remote -v
origin  git@github.com:sekkinsan/bloc-jams.git (fetch)
origin  git@github.com:sekkinsan/bloc-jams.git (push)
origin2 git@github.com:jjydevt/dummy.git (fetch)
origin2 git@github.com:jjydevt/dummy.git (push)
Jacobs-MacBook-Pro:bloc-jams JYUN$ git push origin2 master
To github.com:jjydevt/dummy.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:jjydevt/dummy.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Jacobs-MacBook-Pro:bloc-jams JYUN$


Config SSH
# default GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_rsa

Host github.com/jjydevt
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_jjydevt

0 个答案:

没有答案