【发布时间】:2014-07-07 18:27:45
【问题描述】:
我想拉下一个应用程序,删除所有 git 提交历史并重新推送它,以便整个应用程序在那里并且像以前一样正常运行,但只有一次提交,即“初始提交”。
我正在考虑这样做:
git clone https://github.com/user/user-repo.git
cd user-repo
git reset --hard tags/v2.0
rm -rf .git/
git init
git add .
git commit -m 'first commit'
git remote add stash ssh://git@myserver:7999/myproject/user-repo.git
git push --force stash master
尽管如此,我不确定这是否是实现预期结果的最佳方式。
请帮忙!
谢谢!
【问题讨论】:
-
为什么不删除并重新创建项目?