如何将文件夹/目录添加到github [英] How to add a folder/directory to github

查看:96
本文介绍了如何将文件夹/目录添加到github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将目录直接添加到github存储库,但是由于某种原因,标准git add -A似乎并未添加该文件夹.当我只是将文件添加到仓库中时,普通的推送就可以了,但是由于某种原因,目录似乎不起作用.

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?

谢谢

推荐答案

正常顺序应为

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

别忘了 git commit 步骤.

Don't forget the git commit step.

但是,如果第一步没有添加任何内容,并且您的git最近版本足够(1.8.2+,我建议使用最新的1.9+,因为2.0才是今天早上才发布的),您可以检查一下如果它没有被某些忽略规则忽略(使用 git check-ignore )

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

这篇关于如何将文件夹/目录添加到github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆