Created
March 29, 2014 17:23
-
-
Save pfctgeorge/9858456 to your computer and use it in GitHub Desktop.
add and commit every file in a directory separately
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
import os | |
from subprocess import check_call | |
filenames = list(os.walk("."))[0][2] | |
for filename in filenames: | |
if filename.endswith(".java"): | |
classname = filename.partition(".java")[0] | |
check_call(["git", "add", filename]) | |
check_call(["git", "commit", "-m", | |
"reformat code in services.%s." % classname]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment