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

simple git use case

From
EIErik Iverson <iverson@biostat.wisc.edu>
Date
Feb 5, 2009, 04:52 UTC
Message-ID
<498A7073.4060206@biostat.wisc.edu>
Dear all,

I sincerely hope this is not an annoying question, I promise I have tried to do my homework here, but am stuck. My use case is simple. I have a desktop 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.

OK, so here's what I do.
Desktop (dt):
dt> cd git-test
dt> git-init
Initialized empty Git repository in /home/erik/projects/git-test/.git/
dt> git add .
dt> git-commit -am 'initial commit'
Created initial commit c150815: initial commit
  3 files changed, 14 insertions(+), 0 deletions(-)
  create mode 100644 test.R
  create mode 100644 test.sas
  create mode 100644 test.tex

Looks good... Now over to the laptop (lt)!

lt> git-clone ssh://myip/path/to/project

And great, I have the three test.* files, looks good! So I make some changes to test.R on laptop, like I'm on the road. Then, on laptop:

lt> git-commit -am 'an update'
Looks good.
Now I become a mouth-breather...and need some help :).
My instinct was to git-push from the laptop,
lt> git-push

which succeeds, but then a git-pull from desktop says:

dt> git-pull fatal: 'origin': unable to chdir or not a git archive fatal: The remote end hung up unexpectedly

OK, so look around mailing list archives...I try, without knowing what it means at all:

dt> git-config branch.master.remote .
dt> git-pull
 From .
  * branch            HEAD       -> FETCH_HEAD
Already up-to-date.
Hmmm, so it did something, but not what I'd expect.  How about:

dt> git-checkout M test.R

So it realizes that file has been modified...
dt> git-checkout -f

This gives no message of any type, and now I see my modified test.R file on my desktop, so good! I'm happy with this, but I must know, it this the Right Way to use git for my use case, or am I doing something silly?

Thank you for providing this software.

Best Regards, Erik Iverson

Next: Jay Soffian
Message 1 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.