Subject: Re: clone bug

From: Andreas Schwab <[email-masked]>
Date: Thu, 12 Jan 2012 15:36:46 +0100

Alexey Kuznetsov <[email-masked]> writes:

> axet-laptop:123 axet$ git branch
> * master
> # git remote add common https://github.com/axet/common-bin.git
> # git fetch common
> From https://github.com/axet/common-bin
>  * [new branch]      master     -> common/master
>
> ?? already strange master (local) to the remote common/master

The message means: the remote ref 'refs/heads/master' is stored locally
in 'refs/remotes/common/master'.

> axet-laptop:123 axet$ git push
> To https://github.com/axet/common-bin.git
>  ! [rejected]        master -> master (non-fast-forward)

"git push" is the same as "git push common" ('common' is the current
branch's remote).  Since branch.master.push is not defined this then
uses the push.default config option to determine the action.  The
default is 'matching', which means that local branch names are matched
against remote branch names.  Local branch master matches remote branch
master.  Note that this disregards the setting for
branch.master.upstream.  If you do not want that you should set
push.default to 'upstream'.

See the examples in git-push(1) for more details.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."