6

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.

enter image description here

dev.doc
  • 579
  • 3
  • 11
  • 15
Mike McGuire
  • 199
  • 1
  • 11

3 Answers3

1

That folder is empty.since that folder doesn’t contain anything it’s not committing to the repo!!!

AmilaMGunawardana
  • 1,633
  • 1
  • 7
  • 19
0

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.

Lachlan Lindsay
  • 717
  • 6
  • 20
0

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?

Prasheel
  • 942
  • 4
  • 21