Reputation: 3080
I have 140 git repos on my computer and I can work on 10-15 of them per week. Is there a way to know if If forgot to commit/push for one of my projects?
These repositories are all at the same place: "C:/Projects".
The output would be something like
Thank you!
Upvotes: 2
Views: 214
Reputation: 137312
A pretty simple python script would do it for you:
import glob
import subprocess
import os
from os.path import dirname
dirs = glob.glob('c:/projects/*/.git')
for dir in dirs:
dir = dirname(dir) #strip .git off the end
os.chdir(dir)
status = subprocess.check_call(('git', 'status'))
# Check status, and potentially do this
subprocess.check_call(('git', 'add', '-A'))
subprocess.check_call(('git', 'commit', '-m', 'Automatic Commit'))
subprocess.check_call(('git', 'push', 'origin', 'HEAD'))
That is pretty much it. You would need to get python on your computer and in turn tweak this.
Upvotes: 5