为什么git add -A没有添加这些文件? [英] Why git add -A didn't add these files?

查看:750
本文介绍了为什么git add -A没有添加这些文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 git 管理我的 .emacs.d / ,但我未能添加一些文件:



这里是.gitignore文件:

  * 〜
自动保存列表

为什么 git add -A 无法添加这些文件?使用git管理 .emacs.d 的任何实用建议?



编辑:

 〜/ .emacs.d $ git config -l 
user.email=nickleeh@hotmail.com
user.name = Nick Lee
core.autocrlf =输入
core.editor = sublime -wl1
push.default =简单
color.ui = true
核心.repositoryformatversion = 0
core.filemode = true
core.bare = false
core.logallrefupdates = true
user.email=nickleeh@hotmail.com
〜/ .emacs.d

编辑2



当我尝试添加未跟踪文件时,出现这个致命错误:

 〜/ .emacs .d $ git add el-get / ace-jump-mode / * 
fatal:Pathspec'el-get / ace-jump-mode / README.md'位于子模块'el-get / ace-jump-模式'

事实证明 ace-jump-mode 是一个子模块。我怎么能得到这个?

这是否意味着使用git来管理emacs配置文件不是一个好主意?根据

nofollow> http://git-scm.com/docs/git-add


如果没有< pathspec>是在使用 -A 选项时给出的,整个工作树中的所有文件都被更新(用于限制更新到当前目录及其子目录的Git的旧版本)。


我认为这是您的问题,尽管我看到一个文件位于已添加的子目录中。


I'm trying to use git to manage my .emacs.d/ and I failed to add some files:

And here is the .gitignore file:

*~
auto-save-list

Why git add -A failed to add these files? Any practical advice for managing .emacs.d with git?

Edit:

~/.emacs.d $ git config -l
user.email=nickleeh@hotmail.com
user.name=Nick Lee
core.autocrlf=input
core.editor=sublime -wl1
push.default=simple
color.ui=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
user.email=nickleeh@hotmail.com
~/.emacs.d $ 

Edit 2

When I try to add untracked files, I got this fatal error:

~/.emacs.d $ git add el-get/ace-jump-mode/*
fatal: Pathspec 'el-get/ace-jump-mode/README.md' is in submodule 'el-get/ace-jump-mode'

It turns out that ace-jump-mode is a submodule. How can I get ride of this?

Does that mean using git to manage emacs configuration files is not a good idea?

解决方案

According to http://git-scm.com/docs/git-add,

If no <pathspec> is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).

I assume this is your issue, although I do see one file that is in a sub-directory that was added.

这篇关于为什么git add -A没有添加这些文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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