Skip to content

Instantly share code, notes, and snippets.

@jmbarbier
Created April 6, 2017 21:05
Show Gist options
  • Save jmbarbier/a448d4224eee8e6c3003d3023b1292bc to your computer and use it in GitHub Desktop.
Save jmbarbier/a448d4224eee8e6c3003d3023b1292bc to your computer and use it in GitHub Desktop.
Saving all untracked files from a git repository
git ls-files --others \
| grep -v .DS_Store \
| grep -v .htaccess \
| grep -v .git \
| tr '\n' '\0' \
| xargs -0 -n1 -I '{}' rsync -aP '{}' user@dest:/tmp/nongit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment