我对 git 很陌生。这可能是一个愚蠢的问题,但我真的不知道如何解决这个问题..我一直试图找到答案,但我无法......
我试图使用 React.js 和 Node.js 创建我的项目。我创建了从“npx create-react-app client”创建的 sever.js 和 client 文件夹。当我第一次推送到 git 时,我收到了这个错误消息。
! [rejected] master -> master (fetch first)
error: failed to push some refs
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about …Run Code Online (Sandbox Code Playgroud) 我希望在同一个存储库中拥有服务器和客户端项目。
完成后端后,我从另一个存储库克隆了前端的样板(客户端)。它与src处于同一级别。
将其推送到 github 后,我可以在 client 文件夹中看到一个白色箭头,并且无法打开。按照此链接中的步骤,我从客户端文件夹中删除了.git。但当我这样做时
git add client
Run Code Online (Sandbox Code Playgroud)
或者
git add .
git commit -m "commit"
Run Code Online (Sandbox Code Playgroud)
它说
husky > pre-commit (node v10.16.0)
i No staged files found.
On branch features
nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我最近犯了一个错误,即.git在另一个文件夹中有一个文件夹时推送到我的存储库。这样做会导致我的 GitHub 存储库上出现无法单击的带有白色箭头的文件夹。单击提交消息会显示Submodule XYZ added at abc123。
我已继续进入该文件夹并执行rm -rf .git,但我无法撤消该过程。
我已经查看了其他相关问题并执行了建议的操作,但建议的解决方案似乎不适用于我的案例。
有谁知道我如何才能撤消此操作?谢谢。