git - Comment modifier les messages de commit existants et non-pushed

Mots clés : gitgit-commitgit-rewrite-historygit-amendgit

meilleur 4 Réponses git - Comment modifier les messages de commit existants et non-pushed

vote vote

97

git commit --amend 
git commit --amend -m "New commit message" 
git push <remote> <branch> --force # Or git push <remote> <branch> -f 
// n is the number of commits up to the last commit you want to be able to edit git rebase -i HEAD~n 
vote vote

89

git commit --amend -m "your new message" 
vote vote

72

git commit --amend 
git commit --amend -C HEAD 
git reset --hard HEAD^ 
git rebase -i HEAD~commit_count
git commit --amend git rebase --continue 
vote vote

62

git commit -a --amend -m "My new commit message" 

Questions similaires