<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<big>This is definitely, not an an "advanced" question.<br>
But it is one for which I could not an answer on the Google or in Git
tuts.<br>
<br>
Using Git, can one, without creating a branch, pull a file from an
earlier commit?<br>
And (asking a lot) store the pulled file in a place other than the
current working directory?<br>
<br>
Unless I need to do some more reading, git commands, revert pull and
checkout all seem to operate on the repo as a whole and not on
individual files.<br>
<br>
Tips / comments / guidelines / advice / etc. from those who have gone
before me are welcome.<br>
<br>
Thanks<br>
JohnJ<br>
<br>
</big><br>
<br>
On 2014-04-15 21:44, Chris Frey wrote:
<blockquote cite="mid:20140416014420.GA8521@foursquare.net" type="cite">
<pre wrap="">On Tue, Apr 15, 2014 at 08:47:41PM -0400, John Johnson wrote:
</pre>
<blockquote type="cite">
<pre wrap="">A tip on Git that I read somewhere was to develop a consistent style
in the git commit messages, e.g. git -am [message text], so as to
make subsequent searches easier. For example, if one was using an
issue tracking system with issues SCR 1024 SCR 2031 SCR 112 being
active and the commit was to combine repairs that addressed these
issues, the commit message could be: git commit -am "issues: SCR
1024 SCR 2031 SCR 112" or similar.
</pre>
</blockquote>
<pre wrap="">
That "git commit -am" worries me. :-) My usual process is:
git add -p
git commit # with editor
This allows more detailed commit messages than just a single line.
And the git-add with '-p' makes sure you only commit the changes you
intend. You can also break your current workspace into multiple
commits, making them small and logical.
Also, in git, the first line is special, as you probably know.
But there exists a --grep option in commands such as git-log, for
searching commit messages. For example, if your commit message said:
driver: fixed off-by-one error in buffer init
Changed code to use sizeof() instead of hard coded value.
Fixes SCR 1024, SCR 2031, SCR 112
Now, if you do:
git shortlog
you get a nice brief description of your changes, yet you still have
your bug tracking IDs in the commits, so that this is possible:
git log --grep="SCR 2031"
- Chris
_______________________________________________
kwlug-disc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kwlug-disc@kwlug.org">kwlug-disc@kwlug.org</a>
<a class="moz-txt-link-freetext" href="http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org">http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org</a>
-----
Checked by AVG - <a class="moz-txt-link-abbreviated" href="http://www.avg.com">www.avg.com</a>
Version: 2014.0.4355 / Virus Database: 3882/7345 - Release Date: 04/14/14
</pre>
</blockquote>
<br>
</body>
</html>