Right after successfully pushing all changes on my feature branch to the remote, I try the following on my feature branch and get the following output:
git pull origin master
From git.mycompany:core/main
* branch master -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
Sure. Fine. Maybe I can get more information with the --verbose
flag.
git pull --ff-only --verbose origin master
From git.mycompany:core/main
* branch master -> FETCH_HEAD
= [up to date] master -> origin/master
fatal: Not possible to fast-forward, aborting.
Okay, that doesn't give me much more. This "verbose" message still seems extremely vague. Which leads to my question.
Is there another layer of verbosity I can access when trying to fast forward, in order to debug and fix the problem? If so, how?
Right after successfully pushing all changes on my feature branch to the remote, I try the following on my feature branch and get the following output:
git pull origin master
From git.mycompany:core/main
* branch master -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
Sure. Fine. Maybe I can get more information with the --verbose
flag.
git pull --ff-only --verbose origin master
From git.mycompany:core/main
* branch master -> FETCH_HEAD
= [up to date] master -> origin/master
fatal: Not possible to fast-forward, aborting.
Okay, that doesn't give me much more. This "verbose" message still seems extremely vague. Which leads to my question.
Is there another layer of verbosity I can access when trying to fast forward, in order to debug and fix the problem? If so, how?
Share Improve this question edited Mar 31 at 10:27 Duke of the Trash Heap asked Mar 31 at 7:18 Duke of the Trash HeapDuke of the Trash Heap 234 bronze badges 7 | Show 2 more comments1 Answer
Reset to default 2With git pull
, this is all the verbosity you can get. A fast-foward merge was requested, e.g., by a configuration setting like pull.ff=only
, but a fast-forward merge was not possible.
The next step is to know the relationship between the current HEAD and the branch tip that is being merged, i.e., to get to know the commit graph and commit history.
For a merge, the commit graph can be discovered with this git log
command:
git log --graph --oneline --decorate --boundary HEAD...origin/master
The result may look like this when the histories have diverged:
* c129ba6 (HEAD -> master) more change
* 1f6b196 example commit
* 6cd8049 example fix
| * 2f51d91 (origin/master) example fix
|/
o e244588 start
Of note are:
The triple-dot range notation
A...B
finds those commits that are reachable from only one side of the two end-pointsA
andB
. (Effectively, the commits in bothA..B
andB..A
are listed.) In this example,6cd8049
and above are only reachable fromHEAD
, while2f51d91
is only reachable fromorigin/master
.--boundary
requests that all commits at which the history traversal was stopped are also displayed. In typical simple cases, there is just one such commit, and it is the last commit common to both branches. In--graph
notation it is the one with theo
marker, heree244588
. (In complex histories, or if a pathspec was also given, there is commonly more than one boundary commit.)
If history is complex it may be helpful to also throw in --left-right
. The output marks up from which side the commits are reachable and looks like this:
< c129ba6 (HEAD -> master) more change
< 1f6b196 example commit
< 6cd8049 example fix
| > 2f51d91 (origin/master) example fix
|/
o e244588 start
<
commits are reachable from HEAD
, >
commits are reachable from origin/master
. (It's not very useful in this simple example.)
git log --graph --oneline --decorate --boundary HEAD...origin/master
. Know your commit graph! – j6t Commented Mar 31 at 9:48