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

Re: simple git use case

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Feb 5, 2009, 14:57 UTC
Message-ID
<slrngolvio.sjl.sitaramc@sitaramc.homelinux.net>
In-Reply-To
<76718490902050021u5f53c94aq2f1c20c871c98f9c@mail.gmail.com>
On 2009-02-05, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 8 quoted lines
> On Wed, Feb 4, 2009 at 11:52 PM, Erik Iverson
> <iverson@biostat.wisc.edu> wrote:
>> and a laptop.  When I go on the trips, I'd love to be able to bring my
>> "git-test" directory with me on the laptop, code some, and then get the new
>> revisions back on the desktop when I get home (bonus if I can get the
>> revisions back to my desktop over the internet while still on the road, in
>> case, for example, my laptop gets stolen).  No one else will be working on
>> this stuff, it's strictly for me.
Erik: I have the exact same situation, and I simply use a
bare repository on the same desktop as a go-between.  I
think this is a better way of doing things -- gives you a
lot of flexibility for all sorts of future situations
(someone else joining the project, you having to temporarily
use a *third* machine, etc).
Show 8 quoted lines
> Now, whenever you do a "push" on the laptop, it is *not* a symmetrical
> operation to fetch/merge. Rather, the push updates master on the
> desktop to match master from the laptop. However, the working copy on
> the desktop is not touched. So when you login to the desktop, you need
> to manually refresh the working copy from what was pushed. You do this
> with "git reset --hard master". But be careful, if you have made
> changes on the desktop and not committed them, these changes will be
> lost when you do the reset.

If you have a couple of minutes you may also want to take a look at http://sitaramc.github.com/concepts-and-tips/0-terminology.html#a5 , where I have explained *why* all this is necessary. It doesn't (but probably should) talk about how to set up a bare repo etc...

[Git experts: be kind :-) The site itself is a work in progress, as is my knowledge of git. However, that particular page was written after that explanation and demo actually helped someone]

Previous: Jay Soffian
Message 3 of 3 in “simple git use case”
  1. Erik IversonFeb 5, 2009
  2. Jay SoffianFeb 5, 2009
  3. Sitaram ChamartyFeb 5, 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.