Skip to content

Instantly share code, notes, and snippets.

@erochest
Created December 15, 2014 19:33
Show Gist options
  • Save erochest/585cd40409dff7d2c87f to your computer and use it in GitHub Desktop.
Save erochest/585cd40409dff7d2c87f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import shutil
import subprocess
def git_status():
return subprocess.check_output(
['git', 'status', '--short']
).decode().splitlines()
def main():
for line in git_status().decode().splitlines():
line = line[3:]
if line.startswith('../'):
line = line[3:]
print('{} => {}'.format(line, '/tmp'))
shutil.move(line, '/tmp/')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment