Varun U
Varun U

Reputation: 157

How to add missing folder in Github

I am new to Github and facing the below issue:

  1. I created a project in my local directory (on a Windows box).
  2. I have created a repository in Github and followed the basic instructions given in the page (to add the code to Github).
  3. The entire project got uploaded to Github except one folder.

Could anybody let me know how i could add this folder to repository? Your help will be much appreciated!

Thanks!

Upvotes: 2

Views: 2715

Answers (1)

VonC
VonC

Reputation: 1328652

If that folder is empty, you won't be able to add it directly.

  • Add a file in it (.keep),
  • git add that folder (it will work because of the folder content),
  • git commit
  • and git push.

If that doesn't work:

  • git clone the github repo
  • add your folder in it
  • git add yourfolder
  • git commit -m "yourfolder"
  • git push

Check if you have a .gitignore file anywhere in your repo, to see if "Yourfolder" is declared as ignored.

You also can type:

git check-ignore -v yourfolder

That allows you to check if there is any gitignore rule which would cause yourfolder to be ignored.

Upvotes: 5

Related Questions