Linux

Git 버전 업그레이드

판다조아 2025. 3. 22. 21:29
 

GitHub - git/git: Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the

Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documen...

github.com

 

 

  • 설치 파일 다운로드 
# https://github.com/git/git/releases/tag/<version>

wget https://github.com/git/git/archive/refs/tags/<version>.tar.gz -O git.tar.gz

 

 

  • 소스 빌드용 도구 설치 
yum groupinstall -y "Development Tools"
yum install -y gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

 

 

  • 소스 코드 빌드
# tar 압축 헤제 후 내부 접근
tar -zxf git.tar.gz && cd git-*
 
# MakeFile 생성
make configure

# configure로 설치 경로 설정
./configure --prefix=/usr/local
 
# 설치
make install
 
# 버전 확인
git --version

 

 

  • 환경 변수 설정 방법 (신규 설치 or 설치 경로가 변경되었을 경우)
# git 설치경로 확인
which git
 
# 환경변수 추가
vi /etc/profile

# 하단에 아래항목 추가
export PATH=$PATH:<git 설치 경로>
 
# 환경변수 적용
source /etc/profile

# 버전 확인
git --version