git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Geoffrey Irving" <irving@naml.us>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: git push won't push to a local branch
Date: Sun, 4 May 2008 13:00:08 -0700	[thread overview]
Message-ID: <7f9d599f0805041300h4c541082h7d78625707dbf124@mail.gmail.com> (raw)
In-Reply-To: <20080504191936.GA3119@atjola.homenet>

On Sun, May 4, 2008 at 12:19 PM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> On 2008.05.04 11:49:38 -0700, Geoffrey Irving wrote:
>  > Hello,
>  >
>  > There's an asymmetry between push and pull that seems unnecessary:
>  > pull can pull from local branches, but push can't push to them.  Is
>  > there a reason for this asymmetry?
>  >
>  > In more detail, if I have a working copy with two branches, local and
>  > master, I can use git pull to pull changes from master to local:
>  >
>  > % git checkout local
>  > % git pull . master
>  > ... pulls changes from master to local branch
>  >
>  > If I make a change in local and try to do the reverse with git push,
>  > it gives a confusing non-error message and doesn't do anything:
>  >
>  > % git checkout local
>  > % git rm scratch/pcomm.h
>  > % git commit
>  > % git push . master
>  > Everything up-to-date
>
>  You're pushing master to master ;-) Try "git push . local:master".
>
>  Björn

Yep, that works.  I'll remember to use -v next time I don't know
what's going on.

Is there a reason for the syntax asymmetry?  If git pull defaults to
pulling into my current branch, why does git push default to uselessly
pushing and pulling to the same branch?

Also, can I make a bare "git push" default to "git push . local:master"?

Geoffrey

      reply	other threads:[~2008-05-04 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04 18:49 git push won't push to a local branch Geoffrey Irving
2008-05-04 19:19 ` Björn Steinbrink
2008-05-04 20:00   ` Geoffrey Irving [this message]

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=7f9d599f0805041300h4c541082h7d78625707dbf124@mail.gmail.com \
    --to=irving@naml.us \
    --cc=B.Steinbrink@gmx.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;
as well as URLs for NNTP newsgroup(s).