Let’s imagine, one day you found out that the git repository of your project getting larger and larger, it’s hard to tolerance with ,and many commits were and will never be used ,so you decide to covert the current state to an initiate commit of the whole repository. Let’s just do the following.
1、 clear the whole history with : rm -rf .git
2、 reconstruct a repository : git init
3、 commit the initial commit: git add . && git commit -m ‘Initial commit’
4、 if you want to push it to your github:
git remote add origin git://xxxx
git push –force origin master -u

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据