@ -8,7 +8,7 @@ git-fetch - Download objects and a head from another repository.
@@ -8,7 +8,7 @@ git-fetch - Download objects and a head from another repository.
SYNOPSIS
--------
'git-fetch' <repository> <refspec>...
'git-fetch' <options> <repository> <refspec>...
DESCRIPTION
@ -17,24 +17,16 @@ Fetches named heads or tags from another repository, along with
@@ -17,24 +17,16 @@ Fetches named heads or tags from another repository, along with
the objects necessary to complete them.
The ref names and their object names of fetched refs are stored
in $GIT_DIR/FETCH_HEAD. This information is left for a later merge
in `.git/FETCH_HEAD`. This information is left for a later merge
operation done by "git resolve" or "git octopus".
OPTIONS
-------
include::pull-fetch-param.txt[]
include::fetch-options.txt[]
-a, \--append::
Append ref names and object names of fetched refs to the
existing contents of $GIT_DIR/FETCH_HEAD. Without this
option old data in $GIT_DIR/FETCH_HEAD will be overwritten.
include::pull-fetch-param.txt[]
-u, \--update-head-ok::
By default 'git-fetch' refuses to update the head which
corresponds to the current branch. This flag disables the
check. Note that fetching into the current branch will not
update the index and working directory, so use it with care.
Anyway, let's exit `gitk` (`^Q` or the File menu), and decide that we want
to merge the work we did on the `mybranch` branch into the `master`
branch (which is currently our `HEAD` too). To do that, there's a nice
script called `git resolve`, which wants to know which branches you want
script called `git merge`, which wants to know which branches you want
to resolve and what the merge is all about:
------------
git resolve HEAD mybranch "Merge work in mybranch"
git merge "Merge work in mybranch" HEAD mybranch
------------
where the third argument is going to be used as the commit message if
where the first argument is going to be used as the commit message if
the merge can be resolved automatically.
Now, in this case we've intentionally created a situation where the
@ -851,12 +851,14 @@ merge will need to be fixed up by hand, though, so git will do as much
@@ -851,12 +851,14 @@ merge will need to be fixed up by hand, though, so git will do as much
of it as it can automatically (which in this case is just merge the `example`
file, which had no differences in the `mybranch` branch), and say:
Simple merge failed, trying Automatic merge
Auto-merging hello.
Trying really trivial in-index merge...
fatal: Merge requires file-level merging
Nope.
...
merge: warning: conflicts during merge
ERROR: Merge conflict in hello.
fatal: merge program failed
Automatic merge failed, fix up by hand
Automatic merge failed/prevented; fix up by hand
which is way too verbose, but it basically tells you that it failed the
really trivial merge ("Simple merge") and did an "Automatic merge"
@ -928,7 +930,7 @@ resolve to get the "upstream changes" back to your branch.
@@ -928,7 +930,7 @@ resolve to get the "upstream changes" back to your branch.
------------
git checkout mybranch
git resolve HEAD master "Merge upstream changes."
git merge "Merge upstream changes." HEAD master
------------
This outputs something like this (the actual commit object names
@ -1103,6 +1105,155 @@ the above are equivalent to:
@@ -1103,6 +1105,155 @@ the above are equivalent to: