From: "Zorba" <cr@altmore.co.uk>
To: git@vger.kernel.org
Subject: Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]
Date: Wed, 31 Dec 2008 12:03:03 -0000 [thread overview]
Message-ID: <gjfn28$3k2$4@ger.gmane.org> (raw)
In-Reply-To: alpine.LNX.1.00.0812302143210.19665@iabervon.org
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
diff --git a/ABC.txt b/ABC.txt
deleted file mode 100644
index 83871a5..0000000
--- a/ABC.txt
+++ /dev/null
@@ -1 +0,0 @@
-ABC
diff --git a/AC.txt b/AC.txt
deleted file mode 100644
index 9eadfae..0000000
--- a/AC.txt
+++ /dev/null
@@ -1 +0,0 @@
-AC
diff --git a/BC.txt b/BC.txt
deleted file mode 100644
index b3ac6f5..0000000
--- a/BC.txt
+++ /dev/null
@@ -1 +0,0 @@
-BC
diff --git a/C.txt b/C.txt
deleted file mode 100644
index 06a63fe..0000000
--- a/C.txt
+++ /dev/null
@@ -1 +0,0 @@
-C
(END)
conorr@KINKLADZE /w/GITPLATFORM/swproj
$
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionA
Note: moving to "versionA" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>
HEAD is now at 8ce0d2c... version A
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt AC.txt comment.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionB
Previous HEAD position was 8ce0d2c... version A
HEAD is now at fad9c29... version B
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt BC.txt comment.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionC
Previous HEAD position was fad9c29... version B
HEAD is now at 9cf73cb... version C
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt AC.txt BC.txt C.txt comment.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionD
Previous HEAD position was 9cf73cb... version C
HEAD is now at 8e4b5be... version D
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
comment.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ rm *.*
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionA
Previous HEAD position was 8e4b5be... version D
HEAD is now at 8ce0d2c... version A
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt AC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionB
Previous HEAD position was 8ce0d2c... version A
HEAD is now at fad9c29... version B
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt BC.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionC
Previous HEAD position was fad9c29... version B
HEAD is now at 9cf73cb... version C
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
ABC.txt AC.txt BC.txt C.txt
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ git checkout versionD
Previous HEAD position was 9cf73cb... version C
HEAD is now at 8e4b5be... version D
conorr@KINKLADZE /w/GITPLATFORM/swproj
$ ls
conorr@KINKLADZE /w/GITPLATFORM/swproj
$
"Daniel Barkalow" <barkalow@iabervon.org> wrote in message
>
>> wtf is wrong with
>>
>> git checkout <something>
>>
>> ??
>>
>> ** It doesn't reliably put the files that were in that revision into the
>> working directory - a fairly major flaw, for what I'm using SCM for (and
>> 80% of the market IMHO)
>
> It certainly does for me; I rely on it pretty much constantly. Can you
> give a sequence of commands (ideally the whole sequence from the "git
> init") that leads to a difference?
next prev parent reply other threads:[~2008-12-31 12:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-31 2:27 for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned] Conor Rafferty
2008-12-31 2:35 ` Jeff Whiteside
2008-12-31 2:56 ` Boyd Stephen Smith Jr.
2008-12-31 3:10 ` Daniel Barkalow
2008-12-31 3:49 ` Daniel Barkalow
2008-12-31 12:17 ` Zorba
2008-12-31 13:48 ` Sitaram Chamarty
2008-12-31 16:24 ` Daniel Barkalow
2008-12-31 16:33 ` Sitaram Chamarty
2008-12-31 12:03 ` Zorba [this message]
2008-12-31 13:37 ` Sitaram Chamarty
-- strict thread matches above, loose matches on Subject: below --
2008-12-31 11:10 Conor Rafferty
2008-12-31 16:00 ` Daniel Barkalow
2008-12-31 10:59 Conor Rafferty
2008-12-31 2:30 Conor Rafferty
2008-12-31 3:40 ` Boyd Stephen Smith Jr.
2008-12-31 4:48 ` Junio C Hamano
2008-12-31 5:21 ` Daniel Barkalow
2008-12-31 6:07 ` Junio C Hamano
2008-12-31 15:14 ` Boyd Stephen Smith Jr.
2008-12-30 22:55 Conor Rafferty
2008-12-31 0:12 ` Boyd Stephen Smith Jr.
2008-12-31 2:22 ` Sitaram Chamarty
2008-12-30 22:36 Conor Rafferty
2008-12-30 23:31 ` Boyd Stephen Smith Jr.
2008-12-31 0:15 ` Daniel Barkalow
2008-12-31 2:22 ` Jeff Whiteside
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gjfn28$3k2$4@ger.gmane.org' \
--to=cr@altmore.co.uk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).