I want to reset my remote and local BitBucket git repository to the very beginning, removing all commits, files, history, etc.
How can I do this without deleting the repository itself?
I want to reset my remote and local BitBucket git repository to the very beginning, removing all commits, files, history, etc.
How can I do this without deleting the repository itself?
if you have a clone of the repository you can use terminal to enter the directory for the repository and do
git checkout --orphan latest_branch
git rm *
git rm -r *
git commit -am "resetting"
git branch -D master
git branch -m master
git push -f origin master
commit -am appends to the most recent commit
branch -D deletes the master branch and its commit history
branch -m renames the new branch as master
This will delete the files locally as well
answer based on this previous answer to a similar question
For all branches/tags on the repo, you could just:
git push origin :some-branch-or-tag
Adjust the name of the remote and the branch or tag you want to remove from the repo.