git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Howto request: going home in the middle of something? v2009

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Apr 21, 2009, 13:43 UTC
Message-ID
<237967ef0904210643m2b99dccapbfd10386128c478b@mail.gmail.com>
In-Reply-To
<e2a1d0aa0904210639t2ca73364pff26c85a0224182e@mail.gmail.com>
2009/4/21 Patrick Doyle <wpdster@gmail.com>:
Show 58 quoted lines
> Hello,
> I've developed a work habit of keeping my source code repository on a
> USB stick and carrying that back and forth with me between work and
> home.  (I typically have small, branchless, single-developer
> projects.)  When I arrive at the other machine, I do
>
> $ git pull
> (code, commit, code, commit, etc...)
> $ git push
>
> Occasionally at the end of the day (if I'm at work) or at the end of
> the night (if I'm at home), I'm in the middle of something that I want
> to continue, and I end up making a "work-in-progress" commit
>
> $ git commit -a "WIP"
>
> just so I can pull that in the next day/evening and continue where I
> left off.  But that leaves a bunch of "WIP" commits in my history.  I
> started looking around for a better way to do this, and came across a
> 2007 discussion (at
> http://kerneltrap.org/index.php?q=mailarchive/git/2007/10/18/347020/thread)
> where the OP really wanted (as do I) do be able to do something like
> this:
>
> $ git stash
> $ git push
> $ git stash-push
> (travel to other site)
> $ git pull
> $ git stash-pull
> $ git stash apply
> (continue coding and committing as before)
>
> There were a number of different suggestions, such as:
>
> $ git commit -b temp -a -m "Hold for transport home"
>
> Then when I get home I do this:
>
> $ git fetch work
> $ git merge work/temp
> $ git reset HEAD^
>  # code code code
> $ git commit -b temp -a -m "Hold for transport to work"
>
> When I'm finished at home and want to carry on at work:
>
> $ git fetch --force home
> $ git merge home/temp
> $ git reset HEAD^
>  # start coding for the day
>
> ... or using git-bundle
>
> That discussion dates back to 2007.  Is there a new, improved, 2009
> way of accomplishing this?
>
> --wpd
man git-stash? or you can just git reset --soft HEAD^ away your wip commit.
-- 
Mikael Magnusson
Previous: Patrick DoyleNext: Michael Witten
Message 2 of 4 in “Howto request: going home in the middle of something? v2009”
  1. Patrick DoyleApr 21, 2009
  2. Mikael MagnussonApr 21, 2009
  3. Michael WittenApr 21, 2009
  4. Daniel BarkalowApr 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.