I drag-and-dropped a folder (ChessEngine) to a project after the original project was on GitHub. ChessEngine originally had its own remote repo, so I deleted the .git file from that ChessEngine folder. I then deleted the .git folder from the overall folder (ChessArmyKnife) and ran git init on the larger ChessArmyKnife folder. Still the ChessEngine folder isn't being seen by GitHub.
-
Before committing use git add command and re commit and push again – AmilaMGunawardana Feb 04 '19 at 00:39
-
I tried that. I also ran git init again on the larger ChessArmyKnife folder. – Mike McGuire Feb 04 '19 at 00:43
-
2Is the folder empty? – AmilaMGunawardana Feb 04 '19 at 00:44
-
The folder is not empty. – Mike McGuire Feb 04 '19 at 18:01
-
I solved the issue by simply deleting my remote repo and creating a new one with the same name and then committing the local repo. – Mike McGuire Feb 04 '19 at 18:02
3 Answers
That folder is empty.since that folder doesn’t contain anything it’s not committing to the repo!!!

- 1,604
- 2
- 13
- 32
-
It's not empty in my local repo. That's what I'm trying to commit. – Mike McGuire Feb 04 '19 at 17:34
-
I solved the issue by simply deleting my remote repo and creating a new one with the same name and then committing the local repo. – Mike McGuire Feb 04 '19 at 18:02
That folder isn't getting committed because its either empty or all the files inside it are being ignored.
If the folder is used for content you don't want to commit in your repo but you do want to include the directory you can create a place holder file in the directory, convention is to name the file .gitkeep
then in .gitignore
explicitly add exclude .gitkeep
from the ignored files.
File: ./ChessEngine/.gitignore
*
!.gitkeep
The *
is ignoring all the files in the directory. While !.gitkeep
is explicitly excluding this file from the exclusion rule .gitignore file.

- 768
- 7
- 21
To commit the folder to repo create a .gitkeep file in it and the.n commit it. Git will treat it as an empty folder only, but will allow you to commit.
https://fileinfo.com/extension/gitkeep GITKEEP File Extension - What is a .gitkeep file and how do I open it?

- 985
- 5
- 22
-
-
1I solved the issue by simply deleting my remote repo and creating a new one with the same name and then committing the local repo. – Mike McGuire Feb 04 '19 at 18:03