1

I have a root folder named learn-testing and two child folders client and server.

Here is the folder structure:

 -learn-testing
     -client
     -server

Here is the code I ran to push my code to my github repo:

git init
git add .
git commit -m "login frontend and backend implementation"
git branch -M main
git remote add origin https: ..............................
git push -u origin main

The code did got pushed to my github repo but only the server folder code. A folder for client was made but its icon has a arrow in it and there is not code.

Here is the created folder image:

enter image description here

Now when I try to run the following instructions:

git add .
git commit -m "adding client code``

On git status I am getting the following instruction in my command prompt:

On branch main
Your branch is up to date with 'origin/main'.

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

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

Please guide me on why only half of my code was pushed and also on how to push the client folder code to GitHub

Pawan
  • 459
  • 5
  • 17

1 Answers1

1

It looks like client is a git repo as well. Is it possible that you run git init in client by mistake?

The solution is be to delete .git directory from the client folder.

tymtam
  • 31,798
  • 8
  • 86
  • 126