In Tortoise SVN there is a Repo-Browser where we can simply delete all files and add new files again.
How can we do this in GIT?
repo is not hosted in GITHub and there is no interface apart of the repo url
Why?
I created a local repo and pushed into the remote host, but realized after that was in the wrong directory, so, locally it's easy, just
git init
git add .
git commit -m "New place commit;"
git remote add alias https://[email protected]/reponame.git
git push alias master
but I get the error
To https://[email protected]/reponame.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]/reponame.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Witch is fine as I'm pushing a new repo ... so I just want to clear the remote one in order to be able to push this new one ...
I think you are looking for -f
flag:
git push -f alias master
It will force remote repository to overwrite master
branch.
Just delete the .git
directory at the top level of the repository. Then, in that same directory:
git init
git add .
git commit -am 'Initial commit'
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