2 ms·
You can fix it by replacing the awk with "cut -d ' ' -f 2-" Haven't tested it, but you may also need to throw a "tr '\n' '\0'" in there and call xargs with "-0
by LeoPanthera 6y ago
You can fix it by replacing the awk with "cut -d ' ' -f 2-"
Haven't tested it, but you may also need to throw a "tr '\n' '\0'" in there and call xargs with "-0" to make it happy.
This will still break on files with a CR in the filename.
(CRs are allowed in unix filenames but, imho, they should not be.)
- megous 6y agoyou also want to tell xargs not to run the command on an empty set, otherwise you'll just do 'git checkout --' which will just kill all your local changes, probably.