繁体   English   中英

git add -A。 不添加多个目录和文件

[英]git add -A . not adding multiple directories and files

我正在尝试将一些新目录和文件添加到我在WWW GitHub上创建的github仓库中。 我首先在WWW GitHub上创建了repo,并用自述文件初始化它。 然后我将它克隆到我的本地盒子中,并在目录中添加了一堆文件,目录和文件。

当我做了一个git add ./*以前工作过,在目录中没有识别任何内容,并且没有任何改变。 所以我尝试了git add -A . 同样的事情。 然后我使用了git add *并且它只添加了一个目录中的文件,但它没有添加其他目录。 目录结构是:

zabbix_config_manager
|
| - roles
|| - role_1.rb
|| - role_2.rb
|
| - zabbix_config_manager
|| - attributes
||| - default.rb
||
|| - recipes
||| - default.rb
||| - recipe_1.rb

git status显示如下:

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   roles/role_asp_zabbix_agent.rb
#       new file:   roles/role_corp_server_ceszabbixcrt01.rb
#       new file:   roles/role_corp_server_ceszabbixcrt02.rb
#       new file:   roles/role_corp_server_grdzabbixprd01.rb
#       new file:   roles/role_corp_zabbix_agent.rb
#       new file:   roles/role_corp_zabbix_javagateway.rb
#       new file:   roles/role_corp_zabbix_proxy.rb
#       new file:   roles/role_corp_zabbix_server.rb
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#       modified:   zabbix_config_manager (modified content)
#

我该如何解决这个问题?

我想,您不希望将直接子目录命名为与存储库根目录相同。 然后它将完美地工作。 我使用zabbix-config-manager而不是zabbix_config_manager并且直接在其下面的文件夹命名相同,我能够使用git add . 它毫无障碍地添加了所有内容。

暂无
暂无

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

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