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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andy Parkins
Date: Thursday, October 18, 2007 - 4:29 am

On Thursday 2007 October 18, Jan Wielemaker wrote:


I have two remotes (typically) in my .git/config.  One for the real central 
repository and one for the alternate computer.  The two locations (say home 
and work) list the other as a remote.

So; before I go home I do this:

 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

Obviously if you do this repeatedly you'd need to tidy up the left over temp 
branches, or ensure that your remote configurations list "+" in the fetch 
lines.  You can also use pushes instead of fetches if you're that way 
inclined, or you have a connection problem in one direction because of a 
firewall.

It's slightly inelegant but it does ensure that nothing is ever accidentally 
lost by overwriting new with newer, which happened a few times in the days 
when I used rsync for copying the working directory between computers.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Howto request: going home in the middle of something?, Jan Wielemaker, (Thu Oct 18, 2:44 am)
Re: Howto request: going home in the middle of something?, Johannes Sixt, (Thu Oct 18, 3:37 am)
Re: Howto request: going home in the middle of something?, Andy Parkins, (Thu Oct 18, 4:29 am)
Re: Howto request: going home in the middle of something?, Jan Wielemaker, (Mon Oct 22, 1:44 am)
Re: Howto request: going home in the middle of something?, Johannes Schindelin, (Mon Oct 22, 4:32 am)
Re: Howto request: going home in the middle of something?, Jan Wielemaker, (Tue Oct 23, 11:38 am)
Re: Howto request: going home in the middle of something?, Matthias Kestenholz, (Tue Oct 23, 1:28 pm)