From: "Zorba" <cr@altmore.co.uk>
To: git@vger.kernel.org
Subject: Re: getting started, happy with cmd line on windows [Scanned]
Date: Sat, 27 Dec 2008 02:18:45 -0000 [thread overview]
Message-ID: <gj43am$fu6$3@ger.gmane.org> (raw)
In-Reply-To: 7v4p0qlcnc.fsf@gitster.siamese.dyndns.org
> Drop "rm *.*". Instead, probably what you want is
>
>> $ <import code>
>> $ git init
>> $ git commit
>
> which is a good way to make an initial import.
>
>> $ git tag versionA <commitID>
>> $ hack hack hack
>> ...
>
> and you futzed with the codebase without any intention of committing;
> it is nice to be able to experiment freely.
>
> After you are done experimenting,
>
> $ git reset --hard versionA
>
> if you did not make any commit, or even if you did commit while you were
> experimenting, if you do not want these experimental commits at all.
>
> No need for "rm *.*" anywhere.
Hi Junio,
Yes, I had not considered the possibility of being able to reset to last
commit (as manual page talked about UNDOing commits). $git reset -hard HEAD
= This is great, and gives me the functionality I want, get back to the last
conscious commit after hacking.
I've noticed since discovering this that the Reset function on the Win GUI
will ONLY let you reset as far as but not beyond the last commit (i.e.
unable to undo any commits) so I can use that too.
The other functionality I was looking for is being able to handle a changing
"portfolio" of files from version to version:
e.g.
version A = ABC.txt, AB.txt, AC.txt
version B = ABC.txt, AB.txt
version C = ABC.txt, AC.txt
version D = no files
I'm sure this is a common scenario, for ppl starting out with git as they
load up versions that till now have been sitting in file systems.
By using git-add and git-rm (or git-commit -a) I was able to have my
add/remove files to the index in "staging" and in the end the versions in
the repo match up to real life example. Then I can --hard reset back to any
of these, and ONLY got the files that were in that version.
Its a shame though that git-commit -a only removes files from the index, and
doesn't add files to the index, otherwise creating new versions is just a
case of importing the files needed for eacch version and cranking..
$ git commit -a
repeatedly.
But thanks to all who helped me on this one, and who knows maybe this post
will help some other pilgrim following after me
:-)
Season's geetings,
CR
next prev parent reply other threads:[~2008-12-27 2:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-26 13:52 getting started, happy with cmd line on windows [Scanned] Conor Rafferty
2008-12-26 16:39 ` René Scharfe
2008-12-26 23:13 ` Zorba
2008-12-26 23:50 ` Junio C Hamano
2008-12-27 2:18 ` Zorba [this message]
2008-12-28 18:39 ` Daniel Barkalow
2008-12-30 1:22 ` Zorba
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='gj43am$fu6$3@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).