I tried to diff only .cs files, I use: git diff HEAD -- ./*.cs It just didn't work. Note there are several cs files under different directories. What is the correct command?
Thanks!
I use msysgit in windows. I decided to write a python script for it. Here it 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 captures the 'git status' output, searches the line with the keyword 'modified:', and gets the modified file names. It's ugly. But it works. And it can be extended to handle arguments.