On Sun, Aug 21, 2016 at 8:49 PM, <n...@dad.org> wrote:
> I am learning how to use git. I would like to know:
> How can I correct a typo in the message I gave to an old "git commit"? I see
> that the typo occurs in exactly two files in .git:
> /usr/bin/file says that they are both ASCII English text. So I could just
> hand edit them. But that seems somehow sacrilegious and might break git.
Messages to commits aren't just stored in these two files.
Hand editing them will definitely break git and its highly advisable
not to do that. In fact, for beginners its highly recommended to never
visit the ".git" folder. What you need in this case is `git-rebase
-i`. Using that you can go to the commit where you want to edit the
message and mark it as "reword". Also if you want to make some
modifications in the code, then you can mark it as "edit". Try `man
git-rebase` for more info on the command.
Also on a side note: This is a developer's mailing list. Please try to
use the user's mailing list for doubts. But if you have a doubt as
to why this commands functions in a particular way (in which you think
it should not) or you find a possible bug then feel free to discuss it
on this mailing list. Also to save other people's time, first search
for the doubt in the archives or google about it.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html