Git 설치

한 줄 요약

운영체제별 Git 설치 방법과 설치 확인

설치 전 확인

이미 Git이 설치되어 있을 수 있습니다. 터미널에서 확인해보세요:

git --version

git version 2.x.x 형태로 버전이 출력되면 이미 설치되어 있습니다. → 초기 설정으로 바로 넘어가세요.


macOS

방법 1: Xcode Command Line Tools (권장)

터미널에서 git을 실행하면 설치 안내가 나타납니다:

git --version

팝업이 뜨면 “설치”를 클릭하세요.

방법 2: Homebrew

# Homebrew가 없다면 먼저 설치
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 
# Git 설치
brew install git

방법 3: 공식 설치 파일

git-scm.com/download/mac에서 다운로드


Windows

방법 1: Git for Windows (권장)

  1. git-scm.com/download/win 접속
  2. 설치 파일 다운로드 및 실행
  3. 설치 옵션은 대부분 기본값 유지

설치 시 권장 옵션

  • Default editor: VS Code 선택 (사용 중이라면)
  • PATH environment: “Git from the command line and also from 3rd-party software” 선택
  • Line ending conversions: “Checkout Windows-style, commit Unix-style line endings” 선택

방법 2: winget (Windows 11)

PowerShell에서:

winget install --id Git.Git -e --source winget

설치 후 확인

Git Bash 또는 PowerShell에서:

git --version

Linux

Ubuntu / Debian

sudo apt update
sudo apt install git

Fedora

sudo dnf install git

Arch Linux

sudo pacman -S git

설치 확인

설치가 완료되었는지 확인합니다:

# 버전 확인
git --version
# 출력: git version 2.43.0
 
# 도움말 확인
git help

자주 발생하는 문제

”git: command not found”

원인: Git이 설치되지 않았거나 PATH에 등록되지 않음

해결:

  1. Git이 설치되어 있는지 확인
  2. 터미널/명령 프롬프트를 재시작
  3. Windows의 경우 시스템 재부팅

macOS에서 “xcrun: error”

원인: Xcode Command Line Tools가 제대로 설치되지 않음

해결:

xcode-select --install

Windows에서 한글 깨짐

원인: 인코딩 설정 문제

해결:

git config --global core.quotepath false
git config --global i18n.commitEncoding UTF-8
git config --global i18n.logOutputEncoding UTF-8

다음 단계

Git 설치가 완료되었다면, 사용자 정보를 설정해야 합니다:

초기 설정

더 알아보기