IT 언어/Git
[Git] 설치하기 (MacOS)
비둘기멋지게발차기
2024. 1. 14. 23:27
Mac은 기본적으로 git이 설치 돼있으나, 최신버젼으로 맞춰 새로 설치하면 된다
git 설치하기
1) git 버젼 확인
- 명령어 : git --version
2) Homebrew 설치
- 사이트 : https://brew.sh
- 명령어 : ctrl + c
3) git 사이트의 최신버젼과 맞추기
- 사이트 : https://git-scm.com
4) git 업데이트
- 명령어 : brew install git
4-1) 오류 발생 (zsh: command not found: brew)
home brew의 설치 경로가 달라서 발생한 오류
- M1 칩인 경우 : echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
- M1 칩 아닌 경우 : echo 'export PATH="/usr/local/bin:/usr/local/sbin:$PATH"' >> ~/.zshrc
- 적용 하기 : source ~/.zshrc
- 설치하기 : brew install git