如何清除GIT存储库

bal*_*dre 4 git msysgit

在Tortoise SVN中有一个Repo-Browser,我们可以简单地删除所有文件并再次添加新文件.

我们怎样才能在GIT中做到这一点?

repo不在GITHub中托管,并且repo url没有任何接口

为什么?

我创建了一个本地仓库并推入远程主机,但之后意识到它位于错误的目录中,所以,本地很容易,只是

git init 
git add .
git commit -m "New place commit;"

git remote add alias https://user@domain.com/reponame.git
git push alias master
Run Code Online (Sandbox Code Playgroud)

但我得到了错误

To https://user@domain.com/reponame.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'user@domain.com/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.
Run Code Online (Sandbox Code Playgroud)

女巫很好,因为我正在推动一个新的回购...所以我只是想清除远程的那个以便能够推动这个新的...

max*_*max 6

我想你正在寻找-f旗帜:

git push -f alias master
Run Code Online (Sandbox Code Playgroud)

它将强制远程存储库覆盖master分支.