From: Junio C Hamano <gitster@pobox.com>
To: "Jon Smirl" <jonsmirl@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: ! [rejected] master -> master (non-fast forward)
Date: Sun, 18 Nov 2007 10:10:20 -0800 [thread overview]
Message-ID: <7v7ikfwhkj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <9e4733910711180712n6ee271fau774310e63ab08f6d@mail.gmail.com> (Jon Smirl's message of "Sun, 18 Nov 2007 10:12:10 -0500")
"Jon Smirl" <jonsmirl@gmail.com> writes:
> What's causing this? I'm using stgit on the master branch.
> I'm fixing it each time on the remote server by deleting the ref to master.
>
> jonsmirl@terra:~/ds$ git push digispeaker
> To ssh://jonsmirl1@git.digispeaker.com/~/projects/digispeaker-kernel.git
> ! [rejected] master -> master (non-fast forward)
> error: failed to push to
> 'ssh://jonsmirl1@git.digispeaker.com/~/projects/digispeaker-kernel.git'
> jonsmirl@terra:~/ds$
A "non-fast forward" means that you had this history earlier:
o---o---A
/
---o
pushed "A" to the remote's 'master', then built this history:
o---o---A
/
---o---o---o---o---A'
by rewinding and rebuilding, and the tip of the branch now
points at A', which you tried to push to the remote.
Which often causes troubles for people who are fetching from the
branch you are pushing into, and forbidden by default as a
safety measure.
As long as the people who fetch from the branch knows that you
will regularly rewinding the tip of the branch, there is no
confusion, and you can "force" a non-fast forward update. There
are two independent safety mechanisms:
- the sending end safety can be overriden by "git push --force"
and/or by using a refspec prefixed with a '+');
- the receiving end safety can be overriden by the config
variable receive.denynonfastworwards of the repository you
are pushing into.
The latter defaults to "unsafe", but if the safety is activated
in the repository, forcing from the sending side will not
deactivate it. IOW, both ends need to agree to allow the unsafe
behaviour.
> On the server I have:
> [core]
> repositoryformatversion = 0
> filemode = true
> bare = true
> logallrefupdates = true
>
> bare was set false, I just flipped it to true. The server repo was
> originally created via a clone from kernel.org and then renamed to be
> a bare repo. Why do we need a 'bare' attribute?
There are a few things that change behaviour depending on the
bareness of the repository. One example is that "git fetch"
that updates to the current branch (i.e. what HEAD points at) by
having it as the RHS of a refspec is accepted only for bare
repositories (for non-bare repositories such a fetch would make
the HEAD and the work tree go out-of-sync).
next prev parent reply other threads:[~2007-11-18 18:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-18 15:12 ! [rejected] master -> master (non-fast forward) Jon Smirl
2007-11-18 18:10 ` Junio C Hamano [this message]
2007-11-18 18:42 ` Jon Smirl
2007-11-19 17:47 ` Catalin Marinas
2007-11-19 22:54 ` Jon Smirl
2007-11-20 0:03 ` Daniel Barkalow
2007-11-18 18:29 ` Alex Riesen
2007-11-20 4:16 ` Jeff King
2007-11-20 6:50 ` Alex Riesen
2007-11-20 11:13 ` Jeff King
2007-11-20 11:18 ` [PATCH 1/2] send-pack: cluster ref status reporting Jeff King
2007-11-20 18:22 ` Alex Riesen
2007-11-21 7:24 ` Junio C Hamano
2007-11-21 7:33 ` Jeff King
2007-11-21 7:36 ` Junio C Hamano
2007-11-21 7:39 ` Jeff King
2007-11-21 7:37 ` Jeff King
2007-11-20 11:21 ` [PATCH 2/2] send-pack: print "maybe you need to pull" hint Jeff King
2007-11-20 18:24 ` Alex Riesen
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=7v7ikfwhkj.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jonsmirl@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).