Can git automatically switch between spaces and tabs?
问题 I use tabs for indentation in my python programs, but I would like to collaborate (using git) with people who use spaces instead. Is there a way for git to automatically convert between spaces and tabs (say, 4 spaces = 1 tab) on pushing/fetching? (similar to the CR/LF conversion) 回答1: Here is the complete solution: In your repository, add a file .git/info/attributes which contains: *.py filter=tabspace Linux/Unix Now run the commands: git config --global filter.tabspace.smudge 'unexpand -