简体   繁体   English

在本地将GitHub Repository推送到master分支:不推送文件夹

[英]Locally pushing GitHub Repository to master branch:Not pushing folders

So I've got a local copy of my github repository and just pushed some local changed to the master branch. 因此,我有一个github存储库的本地副本,只是将一些本地更改推送到了master分支。

Only individual files were added and not new folders containing files 仅添加了单个文件,未添加包含文件的新文件夹

Any idea why the folders weren't uploaded? 知道为什么文件夹没有上传吗?


I only used git clone 我只用了git clone

git add . git添加

git commit -m "blah" git commit -m“等等”

git push origin master git push origin master

to make changes to my pre-existing repository I did not make a whole new repository with git init and didn't do anything with "bare" or whatever that command is. 更改现有存储库时,我没有使用git init创建一个全新的存储库,也没有使用“ bare”或该命令执行任何操作。

As determined in the comments to the question - 根据对问题的评论确定-

If you have some files, or any parent folder to those files matching a pattern in the project's .gitignore file, without specific exceptions for the files you are trying to add 如果您有一些文件或这些文件的任何父文件夹与项目的.gitignore文件中的模式匹配,则没有特定的例外,您尝试添加的文件

git add .

Then git will not stage those files , therefore they will not be committed or pushed by subsequent commands. 然后git不会暂存这些文件 ,因此后续命令不会提交或推送它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM