簡體   English   中英

Git 警告:嵌入回購

[英]Git warning: embeded repo

我遇到了 git 的問題。 我要做的就是將反應應用程序上傳到文件夾中。

我正在使用以下內容:

npx create-react-app task_4_1

之后,我出於我的目的更改了src文件夾文件並嘗試推送到 git 現有文件夾。

我得到的警告:

PS C:\Users\Robert\Desktop\New folder> git add .
warning: adding embedded git repository: task_4_1
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: 
hint:   git submodule add <url> task_4_1
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint: 
hint:   git rm --cached task_4_1
hint:

如果我按照 git 命令在 git 中創建所有命令,請參見下圖

圖片

我想要的只是將我的應用程序放在一個文件夾中。 隨着更多的文件夾將在稍后作為學習步驟來到這里。

試圖在這里搜索答案。 沒有一個解決方案實際上有幫助。 沒有一個是同樣的問題。

updated

我希望它是這樣的

在文件夾中

所以我可以在一個 repo 中有 2-8 個不同的 react 應用程序。

如果我在根文件夾中執行所有命令,它就像這樣

無文件夾

當我繼續在那里添加新應用程序時,這將是一個巨大的混亂

如果我從根目錄中刪除 .git 文件,這將意味着所有 node_modules 也將上傳到 git 中,我們不盡量避免嗎?

您不小心創建了兩個 git 文件。 只需將結構設為默認的 create-react-app,然后在根文件夾中執行git init

暫無
暫無

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

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