【发布时间】:2011-08-06 10:48:14
【问题描述】:
在 Tortoise SVN 中有一个Repo-Browser,我们可以简单地删除所有文件并再次添加新文件。
我们如何在 GIT 中做到这一点?
repo 未托管在 GITHub 中,并且除了 repo url 之外没有接口
为什么?
我创建了一个本地repo并推送到远程主机,但后来意识到在错误的目录中,所以,在本地很容易,只是
git init
git add .
git commit -m "New place commit;"
git remote add alias https://user@domain.com/reponame.git
git push alias master
但我得到了错误
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.
Witch 很好,因为我正在推送一个新的仓库……所以我只想清除远程仓库以便能够推送这个新仓库……
【问题讨论】:
-
可能你应该看到这个帖子:[how-do-i-remove-sensitive-files-from-gits-history][1] [1]: stackoverflow.com/questions/872565/…
-
不完全一样,我要全部清除,从头开始,他不会。