问题
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
回答1:
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
来源:https://stackoverflow.com/questions/23924596/how-to-add-a-folder-directory-to-github