2016-01-23 55 views

回答

1

作爲該項目的目錄:

rm -rf .git/ 
git rm -r * 
git init 
git add . 
git remote add origin projects_url 
git commit -m "Remove everything" 
git push -u --force origin master 
+0

我得到這個錯誤「致命的:‘出身’並不似乎是一個Git倉庫 致命的:無法從遠程存儲庫中讀取 請確保您有正確的訪問權限 和存儲庫存在。「 – JayGatsby

+0

我通過添加遠程來源解決了這個問題,但文件不會在我的回購庫中被刪除 – JayGatsby

+0

@JayGatsby哦對,我沒有注意到這些文件,請執行以下操作:第一行後面有'git rm -r *' –

0

推空本地回購與--mirror標誌

$ mkdir practice; cd practice; 
$ git init; git remote add origin [email protected]:user/practice.git; 

$ git push origin --mirror 
remote: error: refusing to delete the current branch: refs/heads/master 
To [email protected]:user/practice.git 
! [remote rejected] master (deletion of the current branch prohibited) 
error: failed to push some refs to '[email protected]:user/practice.git' 

在GitHub上,你可以通過做那麼初始提交推動解決這個問題。

相關問題