【问题标题】:Error with adding all files with git使用 git 添加所有文件时出错
【发布时间】:2014-04-24 01:45:43
【问题描述】:

我过去曾尝试使用 git add -A 添加所有要提交的文件,但现在它不再起作用了。

当我执行命令时,控制台打印出来:

fatal: pathspec '.' did not match any files on branch master

关于为什么会发生这种情况的任何意见?这可能是文件权限问题吗?

一些额外信息:这是基于 Travis-CI 构建的。

【问题讨论】:

  • 您能否将git statusgit config -l 的输出添加到您的问题中。它可能有助于重现该问题。我无法在本地重现该错误。
  • @DavidG user.email=woodyc40@gmail.com user.name=AgentTroll core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.url= AgentTroll@github.com/AgentTroll/BukkitCommons.gitremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
  • 很高兴看到您解决了这个问题 :-)
  • @DavidG 感谢您的支持,我使用了您建议的 PWD 命令来调试一些目录 :)

标签: git continuous-integration file-permissions travis-ci git-add


【解决方案1】:

首先,不要在没有路径规范的情况下使用git add -A。来自git help add 页面:

If no <pathspec> is given, the current version of Git defaults to "."; in other words, update
       all files in the current directory and its subdirectories. This default will change in a future
       version of Git, hence the form without <pathspec> should not be used.

所以我建议你至少把命令改成git add -A .

最后,关于具体问题,我只能建议检查 $PWD 的值以查看构建系统的当前目录在哪里,并尝试检查忽略的文件和删除的文件。

【讨论】:

    【解决方案2】:

    发现我正在推送的目录与推送目录的细微目录名称更改不同。

    【讨论】:

      猜你喜欢
      • 2014-04-06
      • 2020-08-24
      • 2011-03-01
      • 2016-05-03
      • 1970-01-01
      • 1970-01-01
      • 2015-02-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多