当我独自工作时,不理解git的基本知识是可以的,但是现在我和另一个人一起工作,我们每个人都提交拉动请求,让它们被另一个人合并,它就是'开始成为一个问题。
工作流程:我写在我的"作者"科。当我们准备好进行审核时,我会提交一个拉取请求,然后我的编辑器会将其合并到主控中。当她对我发表评论时,她提交了她的编辑分支的拉取请求,并将它们合并为主。
今天,我发现一个完全令人愤怒的循环错误,我不明白我被要求做什么。
thomas@trigger ‹ author ↑● › : ~/pm/wip
[1] % git push
To https://github.com/mathpunk/punk-mathematics-text.git
! [rejected] Editor -> Editor (non-fast-forward)
! [rejected] author -> author (non-fast-forward)
error: failed to push some refs to 'https://github.com/mathpunk/punk-mathematics-text.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
所以,我尝试git pull并得到这个:
thomas@trigger ‹ author ↑● › : ~/pm/wip
[130] % git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.author.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "author"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
与此问题相关的问题在stackoverflow上经常出现,但显然我不太了解git的基本概念,足以理解它们。也许我们的工作流程很疯狂:我们都不是开发人员。我接下来可以尝试什么?