I tried to differentiate only .cs files, I use: git diff HEAD -./*.cs It just didn't work. Note that there are several cs files in different directories. What is the right team?
Thank!
I am using msysgit in windows. I decided to write a python script for it. There he is:
import os
screenOutput = os.popen('git status').read()
lines =screenOutput.splitlines()
keyword = 'modified:'
cmd = 'git diff HEAD -- '
for line in lines:
index = line.find(keyword)
if(index >= 0):
line = line[index + len(keyword) + 1:].strip()
if(line.endswith('.cs')):
cmd += (line + ' ')
os.system(cmd)
The script displays the output of 'git status', looks for the line with the keyword 'modified:' and gets the changed file names. This is ugly. But it does work. And it can be expanded to handle arguments.
source
share