git - resetting a remote repository
It can sometimes be useful to remove the commit history for a project that is under git. and basically make the latest state be the first commit. An example use case might be when uploading to github.
However, if other folk are using the bare repo, then you need to let them know what you are doing.
The process is not at all complex. But first, ensure you have a backup copy of your project somewhere safe.
mv .git/config ~/saved_git_config
rm -rf .git
git add .
git commit -m 'Initial commit'
mv ~/saved_git_config .git/config
git push --force origin master
If you instead, or also, want to push to github (or somewhere else) then do something like this:
git remote add github email@example.com:github_user_name/github_project_name.git
git config branch.master.merge refs/heads/master
git push -u github master