似乎无法将我的目录中的文件夹推送到github

时间:2019-10-15 00:46:50

标签: git github

我尝试了很多不同的事情

enter image description here

但是我的客户文件夹似乎从不希望推送

我的尝试:

git rm -rf --cached client

git add client

然后我推送,它说一切都是最新的。

我尝试过

git add *

git commit

再按一次,一切都保持最新状态。

客户端文件夹是一个create-react-app,我认为git也将忽略其中的/node_modules,否则会引起问题吗? aka我是否必须为客户端设置其他存储库?

我的gitignore文件:

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

1 个答案:

答案 0 :(得分:0)

已解决(具有讽刺意味的是,在我发布问题之后):

因为客户端是另一个具有create-react-app文件夹的node_modules,所以我在尝试git add client时从未注意到它挂起。解决方法很简单,编辑.gitignore文件并添加/client/node_modules并重新添加文件夹。此后,推送成功进行。