How to add a folder/directory to github

巧了我就是萌 提交于 2020-01-03 03:44:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!