Joined July 2015
·

Tom

Singapore
·
·

Posted to Backup all modified files in git. over 1 year ago

I would use xargs -I instead since -i is deprecated. I would also copy using the --parents option to prevent overwriting files with the same name. To be on the safe side, I would add {} after xargs -I or it could result in "{}: No such file or directory" error on some systems:

git ls-files --modified | xargs -I {} cp --parents {} ~/temp

Achievements
1 Karma
0 Total ProTip Views