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)
Here is the complete solution:
In your repository, add a file
.git/info/attributeswhich contains:Linux/Unix
Now run the commands:
OS X
First install coreutils with brew:
Now run the commands:
All systems
You may now check out all the files of your project. You can do that with:
and all the python files will now have tabs instead of spaces.
Edit: changed the forced checkout command. You should commit your work first, of course.