Thread (10 messages) flat view 10 messages, 5 authors, 2016-06-15

Re: How to "git add ." when some files are not accessible (permission denied)?

From: Jeff King <hidden>
Date: 2016-06-15 22:44:19

On Sat, Mar 01, 2008 at 02:46:28PM +0100, Dirk Süsserott wrote:
The question is: is there a way to tell "git add ." to add all files but
ignore those that cannot be added due to lack of authorization?
No, there isn't. Under Linux, I would come up with a list of files I was
interested in and then pipe it to "xargs git-add", which is probably
unhelpful for Windows.

But I think more fundamentally, you probably _do_ want to come up with a
list of files that you can't access and add them to your .gitignore (or
your .git/info/exclude file if they are purely a local matter). That is
the official way to tell all git commands "I really don't care about
these files".  Otherwise they will keep getting brought up when you do,
e.g., a git-status.
Or, more generally spoken: can I tell "git add" to add only those files  
it can handle and ignore the rest? The "-f" switch doesn't work and some
exclude lists on a per file basis are not applicable for my purpose as I
don't know the files in advance.
The only reason I can think of to not want to generate such an ignore
list is if you are frequently and automagically doing a "git add ." to
pick up new files. For that reason, a "try to continue even if we can't
look at some files" option to git add might make some sense.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help