Skip to content

Instantly share code, notes, and snippets.

@pbeardshear
Created August 4, 2014 23:31
Show Gist options
  • Select an option

  • Save pbeardshear/b254bbcfb95b2c81f04b to your computer and use it in GitHub Desktop.

Select an option

Save pbeardshear/b254bbcfb95b2c81f04b to your computer and use it in GitHub Desktop.
Reset all those pesky .csproj files when attaching to w3wp process..
#!/bin/python
from subprocess import call, check_output
out = check_output(['git', 'status', '-s'])
lines = [l.strip().split(' ')[1] for l in out.splitlines()]
for line in lines:
if '.csproj' in line:
remove = raw_input('Reset project: ' + line + '? ')
if remove.lower() == 'y':
print 'Resetting project: ' + line
call(['git', 'checkout', line])
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment