我想要做的是我不希望本地更改的數據庫應用於服務器,我使用Github來處理文件。git rm -rf --cached導致remove db。 &合併衝突git
我在'.gitignore'文件中寫了db.sqlite3。但它不起作用。所以我做了git rm -rf —cached .
和git添加,提交,推送。問題是,儘管我的本地存在DB.sqlite3文件,但它會導致刪除GitHub中的db.sqlite3。
如何在不使用git rm -rf --cached的情況下應用db.sqlite3 gitignore。 ?
當我的Git在Ubuntu(AWS,ubuntu的實例)的拉動。錯誤發生在下面。
your local changes to the following files would be overwritten by merge:
health/db.sqlite3
health/nohup
所以,我做了sudo git stash
而且,當我的git拉,Automatic merge failed: fix conflicts and then commit the result
git的狀態
unmerged paths:
deleted by them : db.sqlite3
both modifiled : management/__pacache__/forms.cpython-35.pyc
因爲,在Git中沒有db.sqlite3。但是我想將我的數據庫存儲在ubuntu服務器中。
我該如何解決問題?
你真的不應該,但鍵入'git add db.sqlite3' –
@CoryMadden然後爲什麼建議呢?通常我們不會在Git中對我們的數據庫進行版本化,因爲它可能是一個很大的二進制文件,並可能導致回購膨脹。 –
使用其他方法備份您的數據庫。 –