From: Lasse Kliemann <lasse@lassekliemann.de>
To: git@vger.kernel.org
Subject: Easy Non-Fast-Forward Pushes
Date: Fri, 27 Feb 2015 16:20:19 +0000 (UTC) [thread overview]
Message-ID: <loom.20150227T170215-199@post.gmane.org> (raw)
As far as I understand, a push will always modify (or add) a ref in the
remote repository. When pushing to branch B, then the ref pointing to the
last commit in this branch will be moved, provided that this can be done in
a fast-forward way. Otherwise the push will fail.
The following options exist:
(1) force the push
(2) fetch, merge, then push
(3) push to a different branch
I don't want (1), for obvious reasons.
Option (2) implies that a particular person has to do the merge, namely the
person for whom the push is failing, or in other words: the person
unfortunate enough not being the first to push. (This reminds me of
Subversion: whoever tries to commit after someone else has committed will
have the burden of an update and possible merge.)
Option (3) allows others to recognize the situation, and anyone with
repository access can do a merge. This is a good thing. However, I am
confused as to what branch name should be used for this. In Mercurial, we
would say that a new "head" is created, and anyone can recognize this by
using "hg heads" and do a merge if he feels competent enough. (A "head" in
Mercurial is a revision without children.) Can something similar be done in
Git? I'd like to provide my co-workers with a command which they can always
use to push their changes to a central repository in order that I can see
what has happened and do merges accordingly. In Mercurial, such a command
would simply be "hg commit && hg push -f". Then I can use "hg heads" to see
if any new heads have grown, and if so, do merges. Upon their next pull,
these merges would manifest themselves in the repositories of my co-workers,
and everything will be fine for them. So, im looking for the equivalent of
that workflow in Git. Thanks a lot!
next reply other threads:[~2015-02-27 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 16:20 Lasse Kliemann [this message]
2015-02-27 17:40 ` Easy Non-Fast-Forward Pushes Stefan Beller
2015-03-01 11:08 ` Lasse Kliemann
2015-03-05 1:42 ` Junio C Hamano
2015-02-27 19:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20150227T170215-199@post.gmane.org \
--to=lasse@lassekliemann.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox