T
T
TriKrista2014-08-09 11:40:32
git
TriKrista, 2014-08-09 11:40:32

How to change the name of a commit in Git?

In general, I fix file changes in something like this.
git commit -a -m "comment"
but in the "comment", at first, he wrote some garbage.
And I would like, in some cases, to correct this "comment".
Can this be done somehow?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EXL, 2014-08-09
@TriKrista

git commit --amend fixes (overwrites) only the last commit. If you need to change the entire history of the project, use the git rebase -i --root command , which you can read about here . Naturally commits should not be public.

A
Alexey Pavlov, 2014-08-09
@lexxpavlov

--amend
but only if you didn't have time to push

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question