...
Code Block | ||
---|---|---|
| ||
$ git --version
git version 2.17.2 (Apple Git-113)
$ brew install git
...
$ git --version
git version 2.17.2 (Apple Git-113)
|
NOTE: The version didn't change even though brew installed the latest version. If this happens, you may need to update the PATH. I did the following to fix the problem.
Edit ~/.bash_profile
Add the following line near bottom of this file...
Code Block |
---|
# required for git installed by Homebrew to be found
export PATH="/usr/locl/bin:${PATH}" |
and execute the following to activate this change...
Code Block |
---|
$ source ~/.bash_profile
$ git --version
git version 2.28.0 |
NOTE: You have to execute the source command in every terminal tab or restart terminal to have it fully take effect.
Configure main as the default repository for all new repos
...
Code Block | ||
---|---|---|
| ||
$ git config --global init.defaultBranch main |
This updates ~/.git
file and adds the following lines...
...