simple git use case
From: Erik Iverson <hidden>
Date: 2016-06-15 22:46:06
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