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 :-)
Date: Wed, 31 Dec 2008 00:31:46 -0000 [thread overview]
Message-ID: <gjeei2$e72$4@ger.gmane.org> (raw)
In-Reply-To: alpine.LNX.1.00.0812301730440.19665@iabervon.org
> So in order for this to make sense, you're going to need to know a little
> tiny bit about branches
** (sigh) At some level I knew I'd have to face up to this... - ok lets do
it
(which, fortunately, is trivial compared to
> branches in most SCMs). In git, a branch is a mutable pointer to a commit,
> which is the latest commit on the branch (all of the earlier commits on
> the branch are linked off of the latest one; each commit points to the one
> before). By default, you have a branch called "master", and that's the
> branch that your series of commands builds up. Now, at any given time, you
> can have a "current branch" (a.k.a. HEAD), which is the branch that you'd
> put a new commit on if you made one. "master" is your current branch while
> you're building up that history.
> When you want to navigate the history, however, you want to leave all of
> the branches alone and take your working directory into the history. This
> is known as being on "(no branch)" or, as Zippy would say, having a
> "detached HEAD". This way you leave the "master" branch pointing to
> versionD, which is, after all, the latest commit, while you get yourself
> an old version. You can do this with:
> $ git checkout versionA
>
> because you've made a tag for it. In order to get back to developing (as
> opposed to looking at history), you use:
>
> $ git checkout master
>
> (because "master" is your branch, while "versionA" is a tag).
>
> If you're on master, either after checking it out explicitly or before
> you've used checkout at all, doing:
>
> $ git checkout versionA .
>
> with *not* switch you away from the current branch, but will get the
> contents of "." from versionA into your index and working directory, and
> it doesn't remove things that you have currently.
** ok, thanks for explaining - one little dot and my HEAD don't get a
holiday !
Now, lets say we checkout versionB. I don't just want to be pointing at
versionB in the repo, I want an exact copy (no more, no less) of all the
files in version B, to be placed in the working tree. Currently this is not
happening reliably.
Is that too much to ask ?
next prev parent reply other threads:[~2008-12-31 0:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 21:56 for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) Zorba
2008-12-28 1:29 ` Zorba
2008-12-29 23:05 ` Jeff Whiteside
2008-12-30 4:24 ` Zorba
2008-12-30 5:33 ` Jeff Whiteside
2008-12-30 12:19 ` Zorba
2008-12-30 5:34 ` Sitaram Chamarty
2008-12-30 16:07 ` Zorba
2008-12-30 17:22 ` Zorba
2008-12-30 17:44 ` Zorba
2008-12-30 18:35 ` Jeff Whiteside
2008-12-30 21:39 ` Zorba
2008-12-30 22:03 ` Jeff Whiteside
2008-12-30 23:29 ` Daniel Barkalow
2008-12-31 0:31 ` Zorba [this message]
2008-12-30 21:27 ` Zorba
2008-12-30 21:49 ` Boyd Stephen Smith Jr.
2008-12-30 22:17 ` Boyd Stephen Smith Jr.
2008-12-30 22:39 ` Boyd Stephen Smith Jr.
2008-12-31 1:43 ` Sitaram Chamarty
2008-12-30 19:42 ` Daniel Barkalow
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='gjeei2$e72$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).