Search code examples
gitgithubgithub-for-windows

adding two folder in one parent folder in one repository github


I have two folder which have two individual projects but inter-related to each other and both folder are in parent folder folder structure is as below

BBYN
|__external
|__spfx

I am trying to add git in BBYN folder but it is not adding. Help me to solve the issue enter image description here


Solution

  • The error that you're getting is because you are trying to make an initial push to the remote repository without having a valid git commit.

    You ran the command git commit -m "Initial commit", without adding the files to the staging area by using git add, and hence there was no git commit made.

    You need to first add your files to the staging area by

    git add external spfx
    

    which would add all the files within those 2 directories to the staging area for the commit, or you can select the required files separately using the same git add command (or git add -A, which would add all the files in the directory to the staging area for the commit).

    Then run git commit -m "Commit message" and then git push origin master to push the changes to the remote repository.