簡體   English   中英

github中未推送create-react-app的內容

[英]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的圖像

這是目標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子文件夾。

然后添加丟失的文件。

嘗試執行以下步驟:

  1. git status驗證哪些文件未被監視,即client文件夾。
  2. git add . -添加所有文件,您可以使用git add filename獲取詳細信息。
  3. git commit -m "My commit message"
  4. git push

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM