{"thread":{"id":"13375","subject":"git push won't push to a local branch","startedAt":"2008-05-04T18:49:38Z","lastAt":"2008-05-04T20:00:08Z","messageCount":3,"participants":["Geoffrey Irving","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76033","messageId":"7f9d599f0805041149w1955138crf269853196391e51@mail.gmail.com","threadId":"13375","inReplyTo":null,"subject":"git push won't push to a local branch","fromName":"Geoffrey Irving","fromEmail":"irving@naml.us","sentAt":"2008-05-04T18:49:38Z","receivedAt":"2008-05-04T18:49:38Z","isPatch":false,"sender":{"key":"irving@naml.us","avatar":"https://gravatar.com/avatar/52d7452fcd134aac0fa12f57a3bb7ef5f3f7e73ca0ab36736d06c6a6132de718?d=mp&s=160"},"body":"Hello,\n\nThere's an asymmetry between push and pull that seems unnecessary:\npull can pull from local branches, but push can't push to them.  Is\nthere a reason for this asymmetry?\n\nIn more detail, if I have a working copy with two branches, local and\nmaster, I can use git pull to pull changes from master to local:\n\n% git checkout local\n% git pull . master\n... pulls changes from master to local branch\n\nIf I make a change in local and try to do the reverse with git push,\nit gives a confusing non-error message and doesn't do anything:\n\n% git checkout local\n% git rm scratch/pcomm.h\n% git commit\n% git push . master\nEverything up-to-date\n\nI can simulate the desired effect by switching to master and doing a pull.\n\n% git checkout master\nSwitched to branch \"master\"\n% git pull . local\nUpdating 0080774..7e8d678\nFast forward\n scratch/pcomm.h |  146 -------------------------------------------------------\n 1 files changed, 0 insertions(+), 146 deletions(-)\n delete mode 100644 scratch/pcomm.h\n\nI'd prefer not to have to switch my checkout to master to accomplish\nthis, since I'll end up with a corrupted working copy if I push from\nsomewhere else to master at the same time (I want to avoid multiple\nrepository copies to save space).\n\nThanks,\nGeoffrey\n"},{"id":"76034","messageId":"20080504191936.GA3119@atjola.homenet","threadId":"13375","inReplyTo":"7f9d599f0805041149w1955138crf269853196391e51@mail.gmail.com","subject":"Re: git push won't push to a local branch","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-05-04T19:19:36Z","receivedAt":"2008-05-04T19:19:36Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.05.04 11:49:38 -0700, Geoffrey Irving wrote:\n> Hello,\n> \n> There's an asymmetry between push and pull that seems unnecessary:\n> pull can pull from local branches, but push can't push to them.  Is\n> there a reason for this asymmetry?\n> \n> In more detail, if I have a working copy with two branches, local and\n> master, I can use git pull to pull changes from master to local:\n> \n> % git checkout local\n> % git pull . master\n> ... pulls changes from master to local branch\n> \n> If I make a change in local and try to do the reverse with git push,\n> it gives a confusing non-error message and doesn't do anything:\n> \n> % git checkout local\n> % git rm scratch/pcomm.h\n> % git commit\n> % git push . master\n> Everything up-to-date\n\nYou're pushing master to master ;-) Try \"git push . local:master\".\n\nBjörn\n"},{"id":"76039","messageId":"7f9d599f0805041300h4c541082h7d78625707dbf124@mail.gmail.com","threadId":"13375","inReplyTo":"20080504191936.GA3119@atjola.homenet","subject":"Re: git push won't push to a local branch","fromName":"Geoffrey Irving","fromEmail":"irving@naml.us","sentAt":"2008-05-04T20:00:08Z","receivedAt":"2008-05-04T20:00:08Z","isPatch":false,"sender":{"key":"irving@naml.us","avatar":"https://gravatar.com/avatar/52d7452fcd134aac0fa12f57a3bb7ef5f3f7e73ca0ab36736d06c6a6132de718?d=mp&s=160"},"body":"On Sun, May 4, 2008 at 12:19 PM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:\n> On 2008.05.04 11:49:38 -0700, Geoffrey Irving wrote:\n>  > Hello,\n>  >\n>  > There's an asymmetry between push and pull that seems unnecessary:\n>  > pull can pull from local branches, but push can't push to them.  Is\n>  > there a reason for this asymmetry?\n>  >\n>  > In more detail, if I have a working copy with two branches, local and\n>  > master, I can use git pull to pull changes from master to local:\n>  >\n>  > % git checkout local\n>  > % git pull . master\n>  > ... pulls changes from master to local branch\n>  >\n>  > If I make a change in local and try to do the reverse with git push,\n>  > it gives a confusing non-error message and doesn't do anything:\n>  >\n>  > % git checkout local\n>  > % git rm scratch/pcomm.h\n>  > % git commit\n>  > % git push . master\n>  > Everything up-to-date\n>\n>  You're pushing master to master ;-) Try \"git push . local:master\".\n>\n>  Björn\n\nYep, that works.  I'll remember to use -v next time I don't know\nwhat's going on.\n\nIs there a reason for the syntax asymmetry?  If git pull defaults to\npulling into my current branch, why does git push default to uselessly\npushing and pulling to the same branch?\n\nAlso, can I make a bare \"git push\" default to \"git push . local:master\"?\n\nGeoffrey\n"}]}