Is it possible to have all “git diff” commands use the “Python diff”, in all git projects?
When including the line
- How to integrate any Python lint with GitHub commit status API?
- Vagrant w/ windows as host, files don´t run on vm due to crlf
- fabric can't detect multiple ssh keys on remote
- Could not find any downloads that satisfy the requirement pypm==1.3.4
- How to make a copy of GitHub repository at each commit using GitPython package in Python
- Setting up a private pypi package?
Is is possible to ask git to use this diff mode for all Python files across all git projects? I tried to set a global ~/.gitattributes, but it is not used by local git repositories. Is there a more convenient method than initializing each new git project with a
ln -s ~/.gitattributes?
3 Solutions collect form web for “Is it possible to have all “git diff” commands use the “Python diff”, in all git projects?”
Attributes that should affect all repositories for a single user should be placed in a file specified by the core.attributesfile configuration option (see git-config(1)). Its default value is $XDG_CONFIG_HOME/git/attributes. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/attributes is used instead. Attributes for all users on a system should be placed in the $(prefix)/etc/gitattributes file.
To tell git to use ~/.gitattributes you need to put this in ~/.gitconfig:
[core] attributesfile = ~/.gitattributes
No, git only looks for attributes locally: