git push won't push to a local branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

I can simulate the desired effect by switching to master and doing a pull.

% git checkout master
Switched to branch "master"
% git pull . local
Updating 0080774..7e8d678
Fast forward
 scratch/pcomm.h |  146 -------------------------------------------------------
 1 files changed, 0 insertions(+), 146 deletions(-)
 delete mode 100644 scratch/pcomm.h

I'd prefer not to have to switch my checkout to master to accomplish
this, since I'll end up with a corrupted working copy if I push from
somewhere else to master at the same time (I want to avoid multiple
repository copies to save space).

Thanks,
Geoffrey
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux