git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Alexey Kuznetsov <kuznetsov.alexey@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: clone bug
Date: Thu, 12 Jan 2012 15:32:06 +0100	[thread overview]
Message-ID: <87aa5tng9l.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <CAO1Zr+pSLwRbsEZ_0LCeE2qLn+S=iMKVcMjqtYrmiBoQmjac_A@mail.gmail.com> (Alexey Kuznetsov's message of "Thu, 12 Jan 2012 16:43:50 +0300")

Alexey Kuznetsov <kuznetsov.alexey@gmail.com> writes:
>
> [branch "common"]
> 	remote = common
> 	merge = refs/heads/master
>
> ?? correct
>
> axet-laptop:123 axet$ git pull
> Already up-to-date.
> axet-laptop:123 axet$ git push
> To https://github.com/axet/common-bin.git
>  ! [rejected]        master -> master (non-fast-forward)
> error: failed to push some refs to 'https://github.com/axet/common-bin.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again.  See the
> 'Note about fast-forwards' section of 'git push --help' for details.
> axet-laptop:123 axet$
>
>
> it tries to push local master to remote common/master which is not correct.

This is controlled by the 'push.default' variable, the docs for which
are as follows:

  push.default::
  	Defines the action git push should take if no refspec is given
  	on the command line, no refspec is configured in the remote, and
  	no refspec is implied by any of the options given on the command
  	line. Possible values are:
  +
  * `nothing` - do not push anything.
  * `matching` - push all matching branches.
    All branches having the same name in both ends are considered to be
    matching. This is the default.
  * `upstream` - push the current branch to its upstream branch.
  * `tracking` - deprecated synonym for `upstream`.
  * `current` - push the current branch to a branch of the same name.

The default of 'matching' pushes X to remotename/X, which is what you
are seeing.  You can either set it to 'upstream' or specify the
target explicitly, as in

  git push common common:master

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-01-12 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 13:43 clone bug Alexey Kuznetsov
2012-01-12 14:32 ` Thomas Rast [this message]
2012-01-12 14:36 ` Andreas Schwab

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=87aa5tng9l.fsf@thomas.inf.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=kuznetsov.alexey@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).