1

I'm trying to add a directory directly to a github repo, but the standard git add -A doesn't seem to be adding the folder for some reason. Normal pushes are working when I'm just adding files to the repo, but directories don't seem to be working for some reason.

Do I have to be doing anything different to push directories?

Thanks

Zack
  • 661
  • 2
  • 11
  • 27
  • possible duplicate of [How do I add an empty directory to a git repository](http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository) – larsks May 29 '14 at 02:00
  • My directory isn't empty. Its full of files I'd like to commit – Zack May 29 '14 at 02:01
  • I stand corrected. Close vote retracted. Can you show us the exact command you're running and the output it generates? And also `git status` afterwards. – larsks May 29 '14 at 02:02
  • 1
    Do you perhaps have a `.git` directory in there? `find -name .git`. Also, try `git check-ignore -v --ignore-index path/to/something/there` – jthill May 29 '14 at 02:07

1 Answers1

2

The normal sequence should be

git add yourDirectory
git commit -m "add a directory content"
git push

Don't forget the git commit step.

But, if the first step doesn't add anything, and if you have a recent enough git (1.8.2+, I would recommend latest 1.9+, considering the 2.0 is out only since this morning), you can check if it isn't ignored by some ignore rule (with git check-ignore)

git check-ignore -v yourDirectory
git check-ignore -v yourDirectory/aFileInThatDirectory
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250