Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge all previous commits into a single commit?

Tags:

git

github

Context: Started project on GitHub and have been experimenting with git commands. The history of the project is untidy.

Question: How can I remove all history and replace all commit messages with something along the lines of "Uploaded initial version of project source"?

like image 624
Lea Hayes Avatar asked Sep 15 '11 04:09

Lea Hayes


1 Answers

This option will allow you to keep all your configuration files for the project
git reset --soft <sha_of_initial_commit>
git commit -a --amend -m "initial commit"

like image 147
Andy Avatar answered Nov 12 '22 20:11

Andy