Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
Ok, starting from scratch, new dir, new repo
I can now get $ git checkout <version> to work (see extract below, missed the first few lines due to exceeding buffer)
The difference with the instance when I found "errors" is that that time I'd run $ git checkout <version> . a few times first, which as I now know, would have been making updates to the index all along.
I presume this is what screwed things up for the normal checkout situation, because when I ran $ git checkout <version> on all the versions, there were always less files than I expected in the working dir
Still not sure if I can trust $ git checkout <version>...
Why should
$ git checkout <version> .
screw things up for
$ git checkout <version>
?
BC
conorr@KINKLADZE /w/GITPLATFORM/swproj $ cat > AC.txt AC
conorr@KINKLADZE /w/GITPLATFORM/swproj $ cat > C.txt C
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt AC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git init Initialized empty Git repository in w:/GITPLATFORM/swproj/.git/
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git add ABC.txt AC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git commit -m "version A"
Created initial commit 8ce0d2c: version A
2 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 ABC.txt
create mode 100644 AC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git tag versiona 8ce0
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git rm AC.txt rm 'AC.txt'
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git add BC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: AC.txt # new file: BC.txt # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git commit -m "version B"
Created commit fad9c29: version B
2 files changed, 1 insertions(+), 2 deletions(-)
delete mode 100644 AC.txt
create mode 100644 BC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git tag versionB fad9
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ cat > AC.txt AC
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt AC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git commit -m "version C" # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # AC.txt # C.txt nothing added to commit but untracked files present (use "git add" to track)
conorr@KINKLADZE /w/GITPLATFORM/swproj $ // mistake - forgot to stage changes sh.exe": //: is a directory
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git reset --hard versionB HEAD is now at fad9c29 version B
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt AC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git add *c*.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: AC.txt # new file: C.txt #
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git commit -m "version C"
Created commit 9cf73cb: version C
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 AC.txt
create mode 100644 C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git tag versionC 9cf7
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt AC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git rm *.* rm 'ABC.txt' rm 'AC.txt' rm 'BC.txt' rm 'C.txt'
conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git commit -m "version D"
Created commit 8e4b5be: version D
4 files changed, 0 insertions(+), 4 deletions(-)
delete mode 100644 ABC.txt
delete mode 100644 AC.txt
delete mode 100644 BC.txt
delete mode 100644 C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git tag versionD 8e4b
conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch master nothing to commit (working directory clean)
conorr@KINKLADZE /w/GITPLATFORM/swproj $ gitk
conorr@KINKLADZE /w/GITPLATFORM/swproj <sionA = ABC.txt, AC.txt, version B = ABC.txt, BC.txt sh.exe": //: is a directory
conorr@KINKLADZE /w/GITPLATFORM/swproj $ cat > commet.txt// gitk confirms that versionA = ABC.txt, AC.txt, sh.exe": commet.txt//: No such file or directory
conorr@KINKLADZE /w/GITPLATFORM/swproj $ cat > comment.txt gitk confirms that: versionA = ABC.txt, AC.txt versionB = ABC.txt, BC.txt versionC = ABC.txt, AC.txt, BC.txt, C.txt versionD =
conorr@KINKLADZE /w/GITPLATFORM/swproj $ gitk
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git show
WARNING: terminal is not fully functional
commit 8e4b5bed1faadc608fc114e62bf1859b6bbed4a0
Author: Conor Rafferty <cr@altmore.co.uk>
Date: Wed Dec 31 11:40:45 2008 +0000
version D