2

I pushed go & react codes to github.

Go codes are successfully commited but React codes are not.

React content is created by create-react-app.

article
├ api
│  └ main.go
└ client
   └ React content made by create-react-app

image of github

Here is target github

https://github.com/jpskgc/article

I trid following command, but not solved.

error: the following file has staged content different from both the
file and the HEAD:
    client
(use -f to force removal)
$ git rm --cached client -f
rm 'client'

Also i tried following command, but issue is not solved

$ rm -rf client/.git

contents of client folder is to be commited in github. but actually not committed.

jpskgc
  • 657
  • 14
  • 27

2 Answers2

14

The problem is both directories are git repositories in which case you would have a submodule.
You can see a submodule is added by this commit Subproject commit 395ee793f20a65d483a50cb1d11b67e7f80729d0.
To remove git submodule but keep files follow this instructions.

mv client subfolder_tmp
git submodule deinit client
git rm --cached client
mv subfolder_tmp client
git add client
Moti Korets
  • 3,738
  • 2
  • 26
  • 35
1

I might be a bit too late to come to this post. But in case anyone still wondering how to fix it. Here is what worked for me:

// moving to your client folder or whatever 
// the react-app folder is called
cd client
// remove the git in this folder
rm -rf client/.git

Now you go back to you root directory and do the add, commit, and push. You should have all your react-app folder pushed to the repository you want to.

Master_AJ
  • 11
  • 1