[英]Content of create-react-app is not pushed in github
我將go&react代碼推送到github。
Go代碼已成功提交,但React代碼未成功提交。
React內容是由create-react-app
。
article
├ api
│ └ main.go
└ client
└ React content made by create-react-app
這是目標github
https://github.com/jpskgc/article
我試過以下命令,但未解決。
error: the following file has staged content different from both the
file and the HEAD:
client
(use -f to force removal)
$ git rm --cached client -f
rm 'client'
我也嘗試了以下命令,但問題沒有解決
$ rm -rf client/.git
客戶文件夾的內容將在github中提交。 但實際上沒有承諾。
問題是兩個目錄都是git存儲庫,在這種情況下,您將有一個子模塊 。
您可以看到此提交添加了一個子模塊Subproject commit 395ee793f20a65d483a50cb1d11b67e7f80729d0
。
要刪除git子模塊但保留文件,請遵循以下說明。
mv client subfolder_tmp
git submodule deinit client
git rm --cached client
mv subfolder_tmp client
git add client
確保您只有一個git存儲庫:檢查存儲庫中沒有.git
子文件夾。
然后添加丟失的文件。
嘗試執行以下步驟:
git status
驗證哪些文件未被監視,即client
文件夾。 git add .
-添加所有文件,您可以使用git add filename
獲取詳細信息。 git commit -m "My commit message"
git push
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.