How to remove default GIT or update it?

sudo rm -rf /usr/bin/git wont work for El Capitan due to SIP restriction

simple solution is create alias

alias git='/usr/local/bin/git'


Use the below only if you want to remove the default GIT. You can still use package managers like homebrew and macports to install an alternative GIT.


The /usr/bin directory is restricted by SIP. You first need to temporarily disable it by booting to recovery, starting Terminal, and executing csrutil disable (then csrutil enable to re-enable`).

Once you have SIP disabled, you can remove git from /usr/bin.

See Also:

  • https://support.apple.com/en-us/HT204899 (About SIP)

Note: You can check for SIP restrictions with the -Ol flags with ls. If it isn't restricted, you will see a hyphen, and if it is, you will see restricted.