我放弃!每当我尝试推动时,我都会变得愚蠢:
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@github.com:companyX/projectX.git'
我们的团队有一个新的 git 设置。我现在没有创建私有分支,而是将我们的主存储库(在 github 上)创建为我自己的副本。
在某些时候,我所做的是:
$ git fetch upstream master:upstreammaster
所以这是我当前的设置::
$ git branch
master
* upstreammaster
$ git remote -v
origin git@github.com:userX/projectX.git
upstream git@github.com:companyX/projectX.git
其中 userX 是我的私人存储库。
所以我去对我的 upstreammaster 分支和“upstream master”的 PULL 进行一些更改。一切都合并和东西:
$ git pull upstream master
remote: Counting objects: 95, done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 60 (delta 54), reused 0 (delta 0)
Unpacking objects: 100% (60/60), done.
From git@github.com:companyX/projectX
* branch master -> FETCH_HEAD
Merge made by recursive.
stuff | 165 ++++++++++++--------
stuff | 35 ++--
stuff | 107 ++++++++++---
stuff | 105 ++++++++++---
stuff | 24 ++--
stuff | 9 +-
stuff | 53 +++----
stuff | 44 +++---
stuff | 52 +++----
stuff | 32 +----
stuff | 4 +-
stuff | 138 ++++++++---------
stuff | 58 ++++----
stuff | 115 ++++++++------
stuff | 5 +-
stuff | 39 ++---
stuff | 28 ++--
17 files changed, 560 insertions(+), 453 deletions(-)
但是当我尝试这样做时:
$ git push upstream master
To git@github.com:companyX/projectX.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@github.com:companyX/projectX.git'
任何帮助将不胜感激!如果您需要澄清,请询问,我会回复!