{"thread":{"id":"26318","subject":"Move git-stash from one machine (or working copy) to another","startedAt":"2011-01-21T14:54:50Z","lastAt":"2011-01-23T10:08:13Z","messageCount":5,"participants":["Patrick Doyle","Junio C Hamano","David Aguilar","Matthieu Moy","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159751","messageId":"AANLkTin2M+dLUOFnAKqNvYn04NumCmmQ331Yfb9ieW-D@mail.gmail.com","threadId":"26318","inReplyTo":null,"subject":"Move git-stash from one machine (or working copy) to another","fromName":"Patrick Doyle","fromEmail":"wpdster@gmail.com","sentAt":"2011-01-21T14:54:50Z","receivedAt":"2011-01-21T14:54:50Z","isPatch":false,"sender":{"key":"wpdster@gmail.com","avatar":null},"body":"Is there an easy way to move work in progress from one machine to another?\n\nOne way to do it might be something like this:\n\nmachine1$ git checkout -b movewip\nmachine1$ git add .\nmachine1$ git commit -m \"Moving work in progress\"\nmachine1$ git push origin movewip:movewip\n\nmachine2$ git fetch origin movewip:movewip:\nmachine2$ git checkout movewip\nmachine2$ git reset HEAD^\nmachine2$ git stash\nmachine2$ git checkout master\nmachine2$ git stash pop\n\n# go through and delete movewip branches on machine1, machine2, and\nthe origin server\n\nExcept for some possible typos, this seems like it would work, but\nseems to be awfully clumsy.  Is there a more elegant way to accomplish\nthis?\n\nIt seems to me that if I could git-stash on machine1, take that stash\nwith me (somehow) to machine2, and then pop it there, that would be\neasier.\n--wpd\n"},{"id":"159763","messageId":"7vfwsmp2op.fsf@alter.siamese.dyndns.org","threadId":"26318","inReplyTo":"AANLkTin2M+dLUOFnAKqNvYn04NumCmmQ331Yfb9ieW-D@mail.gmail.com","subject":"Re: Move git-stash from one machine (or working copy) to another","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-21T17:49:26Z","receivedAt":"2011-01-21T17:49:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Doyle <wpdster@gmail.com> writes:\n\n> Is there an easy way to move work in progress from one machine to another?\n>\n> One way to do it might be something like this:\n>\n> machine1$ git checkout -b movewip\n> machine1$ git add .\n> machine1$ git commit -m \"Moving work in progress\"\n> machine1$ git push origin movewip:movewip\n>\n> machine2$ git fetch origin movewip:movewip:\n> machine2$ git checkout movewip\n> machine2$ git reset HEAD^\n> machine2$ git stash\n> machine2$ git checkout master\n> machine2$ git stash pop\n>\n> # go through and delete movewip branches on machine1, machine2, and\n> the origin server\n>\n> Except for some possible typos, this seems like it would work, but\n> seems to be awfully clumsy.  Is there a more elegant way to accomplish\n> this?\n\nIf your two machines can talk directly with each other (which seems to be\nthe case from your \"take that with me (somehow) to machine2\"), you don't\nhave to push and fetch through the origin.\n"},{"id":"159793","messageId":"1E3784B5-76A2-4071-989D-46E271BB1BAC@gmail.com","threadId":"26318","inReplyTo":"7vfwsmp2op.fsf@alter.siamese.dyndns.org","subject":"Re: Move git-stash from one machine (or working copy) to another","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2011-01-23T02:05:20Z","receivedAt":"2011-01-23T02:05:20Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Jan 21, 2011, at 9:49 AM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> Patrick Doyle <wpdster@gmail.com> writes:\n>\n>> Is there an easy way to move work in progress from one machine to  \n>> another?\n>>\n>> One way to do it might be something like this:\n>>\n>> machine1$ git checkout -b movewip\n>> machine1$ git add .\n>> machine1$ git commit -m \"Moving work in progress\"\n>> machine1$ git push origin movewip:movewip\n>>\n>> machine2$ git fetch origin movewip:movewip:\n>> machine2$ git checkout movewip\n>> machine2$ git reset HEAD^\n>> machine2$ git stash\n>> machine2$ git checkout master\n>> machine2$ git stash pop\n>>\n>> # go through and delete movewip branches on machine1, machine2, and\n>> the origin server\n>>\n>> Except for some possible typos, this seems like it would work, but\n>> seems to be awfully clumsy.  Is there a more elegant way to  \n>> accomplish\n>> this?\n>\n> If your two machines can talk directly with each other (which seems  \n> to be\n> the case from your \"take that with me (somehow) to machine2\"), you  \n> don't\n> have to push and fetch through the origin.\n\nThis won't handle all cases, but it should do the trick 80%+ of the  \ntime.\n\n% git diff > foo.patch\n\n(on other machine)\n% git apply foo.patch\n\n-- \n         David\n"},{"id":"159794","messageId":"vpqaaisj8i2.fsf@bauges.imag.fr","threadId":"26318","inReplyTo":"1E3784B5-76A2-4071-989D-46E271BB1BAC@gmail.com","subject":"Re: Move git-stash from one machine (or working copy) to another","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-01-23T09:04:53Z","receivedAt":"2011-01-23T09:04:53Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> This won't handle all cases, but it should do the trick 80%+ of the\n> time.\n>\n> % git diff > foo.patch\n\nOr, if the patch produced by \"git diff\" doesn't do it:\n\ngit commit -am foo\ngit format-patch -1\ngit reset HEAD^\n\n> (on other machine)\n> % git apply foo.patch\n\nIn one command:\n\ngit diff | ssh other-machine 'cd /path/to/repo && git apply'\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"159795","messageId":"m2y66caq5u.fsf@whitebox.home","threadId":"26318","inReplyTo":"AANLkTin2M+dLUOFnAKqNvYn04NumCmmQ331Yfb9ieW-D@mail.gmail.com","subject":"Re: Move git-stash from one machine (or working copy) to another","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2011-01-23T10:08:13Z","receivedAt":"2011-01-23T10:08:13Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Patrick Doyle <wpdster@gmail.com> writes:\n\n> It seems to me that if I could git-stash on machine1, take that stash\n> with me (somehow) to machine2, and then pop it there, that would be\n> easier.\n\nmachine1$ git stash\n\nmachine2$ git fetch machine1:/repo refs/stash\nmachine2$ git checkout FETCH_HEAD .\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}