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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King schrieb:
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.

Not quite. I'm using the msysGit package from http://code.google.com/p/msysgit/downloads/list and that comes with some fundamental unix tools like a sound shell, find, xargs, and many more. Very good! This way prepared, I used "git ls-files -o | xargs git add -v" until most of my files were added.
For the rest I did "xargs -l" (ell) so that the files got added one by one.
The files that still refused to be added are finally ignored by "git ls-files -o >> .gitignore".

Caveat: filenames containing blanks are not handled properly as they are not surrounded by quotes. "git add" thinks of them as two or more files and fails. I figure xargs has some cool switches to sourround the parameters with quotes, but I didn't find them. An option was to write a script or shell function that does it and pipe the filenames through that function or -- as filenames with blanks aren't so numerous -- to add them manually with "git gui".

Eventually, I solved the problem. Thanks for and to your pointers. :-)

 -- Dirk

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux