我想在主文件夹
mern
上初始化git,但不在frontend
文件夹上初始化git,但如果我尝试从frontend
中删除git文件夹,我仍然看到(master)
文本,这就是我正在尝试的:
Jim@DESKTOP-NC66H5I MILGW64 ~/Desktop/pro/mern/frontend (master)
$ rm -rf .git
Jim@DESKTOP-NC66H5I MILGW64 ~/Desktop/pro/mern/frontend (master)
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: ../.gitignore
new file: ../app.js
new file: ../inc/auth.js
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: ../Procfile
modified: ../app.js
modified: ../package.json
Untracked files:
(use "git add <file>..." to include in what will be committed)
./
Jim@DESKTOP-NC66H5I MILGW64 ~/Desktop/pro/mern/frontend (master)
你看,使用
rm -rf .git
时我仍然可以看到(master)
,这意味着git文件夹没有被删除?这是什么意思?
新手请帮忙
尝试使用以下步骤:
rm -rf frontend/.git
检查前端文件夹是否仍被跟踪:
cd mern
git status
如果前端仍在被跟踪,您可以使用以下命令从 meern 存储库中取消跟踪:
git rm -r --cached frontend
然后使用此命令提交更改:
git commit -m " untrack frontend folder"