Information Technology Reference
In-Depth Information
Set the comment for the new revision to be
abc
. The details of inter-
active rebasing are described in Recipe 8-3.
5. Your
new-web-interface
branch contains a new revisions
abc
.
You can check it with
$ git log --oneline
.
6. The revision
abc
is not merged into the
master
branch yet. You can
check it with:
$ git log --oneline master..new-web-in-
terface
7. Republish your work with :
$ git push -f origin new-web-
interface
How It Works
The command
$ git push -f origin new-web-interface
forces git to
update the remote branch
new-web-interface
even if it causes the history to be
rewritten. By default
$ git push
succeeds only for fast-forward updates. If you
know what you are doing you can use
-f
flag to force the transfer.
Git allows you to configure a repository that rejects all non-fast-forward updates
with
$ git push
, even when the
-f
flag is used. You can achieve this by setting the
receive.denyNonFastForwards
to
true
. If you run:
$ git config receive.denyNonFastForwards true
in
shared-repo
, then you will forbid all pushes that change the history.
Hint
Other options that concern pushing can be found in
$ git config --
help
manual. Many of them start with the
receive
prefix.
10-11. Finishing the work on the remote
branch
Problem