install git on mac with brew code example Example 1: download git for mac $ brew install git Example 2: install git mac book m1 $ sudo dnf install git-all