首页 > 解决方案 > 无法将创建反应应用程序内容添加到回购

问题描述

我正在尝试创建反应应用程序,并且我有一个 nodejs (express) 后端

这是回购的链接, 可以在回购中看到文件客户端为空

我无法添加(暂存)客户端文件,git add.然后 git status 我收到以下消息

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in
submodules)
    modified:   client (modified content, untracked content)
    modified:   package.json

no changes added to commit (use "git add" and/or "git commit -a")

我试过了git add .git add client 但没有任何效果我无法将客户端文件推送到 github

ls -all返回这个:

total 55
drwxr-xr-x 1 user 197121     0 Jun 20 16:38 ./
drwxr-xr-x 1 user 197121     0 Jun 20 15:11 ../
drwxr-xr-x 1 user 197121     0 Jun 21 10:24 .git/
-rw-r--r-- 1 user 197121    15 Jun 20 15:18 .gitignore
drwxr-xr-x 1 user 197121     0 Jun 20 15:57 client/
drwxr-xr-x 1 user 197121     0 Jun 20 15:14 node_modules/
-rw-r--r-- 1 user 197121   362 Jun 20 17:14 package.json
-rw-r--r-- 1 user 197121 14290 Jun 20 15:14 package-lock.json
-rw-r--r-- 1 user 197121   389 Jun 20 15:17 server.js

标签: reactjsgitgithub

解决方案


尝试执行

git rm -rf --cached client

git add client

在客户端目录中。


推荐阅读