Deleting the .git folder may cause problems in your git repository. If you want to delete all your commit history but keep the code in its current state, it is very safe to do it as in the following:

Checkout

git checkout --orphan latest_branch

Add all the files

git add -A

Commit the changes

git commit -am "commit message"

Delete the branch

git branch -D master

Rename the current branch to master

git branch -m master

Finally, force update your repository

git push -f origin master

PS: this will not keep your old commit history around

标签: 运维 GitHub
⇠ 三星Galaxy S10爆炸 中国使用恶意软件扫描游客手机 ⇢

GFW VPN

提供vpn服务,针对中国互联网用户,完全可以突破GFW的封锁. 经过了长期测试,运行非常的稳定.

Send Mail

注册账号