开发者

How to merge all previous commits into a single commit?

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"?


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"


Remove the .git directory.

git init
git add .
git commit -m "Initial commit"
git push origin master

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜