0

I am working on a project and using github as our source control server. The project is private and I want to make it public. But some credential is saved in the history of my git repo. I want to remove the history of commits and only keep the last commits for all branches. I know that I can do this by below commands.

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

but I am worried about other team members. If I follow above steps to clear the history but other team members don't, will they have trouble when they run git pull? Or will they bring the history back when they run git push?

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523

1 Answers1

0
  • Clone repository in state you want your project to go public
  • Create new repository
  • Push to that fresh repository

Repo will be fresh with no history as a good working base.

Antoniossss
  • 31,590
  • 6
  • 57
  • 99