Last active
August 29, 2015 14:16
-
-
Save ethers/4f2cab393d13b8000c55 to your computer and use it in GitHub Desktop.
move untracked files outside a git repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Found from https://snipt.net/akaihola/move-untracked-files-outside-a-git-repository/ | |
git ls-files --others --exclude-standard -z | cpio -pmd0 ../untracked/ | |
# git clean -d -f | |
# git ls-files: print a | |
# * null-delimited (-z) list of | |
# * untracked (--others) | |
# * non-ignored (--exclude-standard) files. | |
# cpio: | |
# * copy (-p) | |
# * files in a null-delimited list (-0) | |
# * create missing directories (-d) | |
# * preserve modification times (-m) | |
# git clean: remove untracked non-ignored files | |
# * and empty directories (-d) | |
# from the working tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment