Re: How to "git add ." when some files are not accessible (permission denied)?
- From
Jeff King <peff@peff.net>
- Date
- Mar 2, 2008, 01:19 UTC
- Message-ID
- <20080302011900.GC22843@coredump.intra.peff.net>
- In-Reply-To
- <47C95E34.1050306@dirk.my1.cc>
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