我正在开发一个项目并使用github作为我们的源代码管理服务器。该项目是私人的,我想公开。但有些凭证保存在我的git回购的历史记录中。我想删除提交的历史记录,只保留所有分支的最后提交。我知道我可以通过下面的命令来做到这一点。如何为所有团队成员删除github历史记录
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
但我担心其他队员。如果我按照上面的步骤清除历史记录,但其他队员没有,那么他们在运行git pull
时是否会遇到麻烦?或者他们会在运行git push
时将历史记录恢复过来?在状态
他们应该做什么描述[这里](https://stackoverflow.com/q/4084868/2303202) – max630