I created new remote git repository and already pushed something in there - first test push and then real code push from local. I want to start from scratch so I can creat few branches (master = ready to release code, test branch and branches for developers) and give them different permissions per user.
Can I empty the existing remote repository somehow? It's a remote git repository that sits on linux and developer and I run windows box.
I don't think it is very useful, but you can restart the master branch (forgetting all history) by
rm .git/index .git/refs/heads/master
echo "Hello!" > README
git add README
git commit -m "Exterminate! Exterminate!"
and push to your remote repository. Usually I would just start over with an empty repository, add your remote repository and push from there.
Some explanation: The first line deletes the index (so your next commit won't contain any files) and the current pointer to the tip of the master branch (so your next commit won't be committed on top of any previous commit). In the second and third line, we add some content to our new repository and commit that content in the fourth line.
If you want the repo gone, just take it away! Delete the whole containing directory, and recreate it as you see fit.
Yes, you could also make a new repo just on your end, and force push to the remote, and remotely delete all the refs, and then make sure git gc
gets run on it... but that takes time and effort. Just wipe it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With