Created
May 29, 2014 22:22
-
-
Save mchinen/7e2db41f5db7fa1ff146 to your computer and use it in GitHub Desktop.
backup git clean files before cleaning
This file contains 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
# get the list of clean files | |
git status>cleanlist | |
# go in with an editor and delete everything before "Untracked files:\n (use "git add...") " | |
openuptexteditoranddeletethenon-untrackedfilelinesuntilwehavearealcommandtodothisautomatically | |
mkdir cleanbackupdir | |
sed -e "s/^\(.*\)$/mv \\1 cleanbackupdir/g"<cleanlist > cleanlistcmd | |
chmod +x cleanlistcmd | |
./cleanlistcmd | |
mv cleanbackupdir ~/somewheresafe/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment