Answers for "how to rename past commits github"

3

How to rename a commit ?

git commit --amend -m "New commit message."
Copy
Posted by: Guest on December-14-2021
5

github change last commit message

# for the most recent commit
git commit --amend -m "changed commits"
git push -f
# for n older commits
git rebase -i HEAD~n
# use r for reword to edit older commits
# removing a line means THAT COMMIT WILL BE LOST. 
git rebase --continue
# solve conflicts if exist
git push -f
# git push --force-with-lease origin <branch> is safer
Posted by: Guest on November-08-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language