Skip to content

Instantly share code, notes, and snippets.

@ruiwen
Created September 10, 2013 14:47
Show Gist options
  • Save ruiwen/6510503 to your computer and use it in GitHub Desktop.
Save ruiwen/6510503 to your computer and use it in GitHub Desktop.
Move tracked files in git into a particular directory
$ mkdir rb
$ for i in `git ls-tree HEAD | cut -f2`; do git mv ${i} rb/; done
# Optional - undo the move for those that shouldn't have been moved
$ git reset HEAD {.gitignore,Procfile,requirements.txt,scripts,minions}
$ git checkout -- {.gitignore,Procfile,requirements.txt,scripts,minions}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment