본문 바로가기
GIT

[GIT] GIT 설치, 셋팅 및 명령어

by mikrw 2023. 1. 20.

Git(깃)은 컴퓨터 파일의 변경사항을 추적하고 여러 사용자들 간에 해당 파일 작업을 조율하기 위한 대표적인 버전 관리 시스템(VCS)입니다.

 

https://git-scm.com/downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

 

git 버전 확인

$ git --version

 

git 초기 셋팅

# 개행 문자(Newline) 설정
## macOS, Linux
$ git config --global core.autocrlf input
## Windows $ git config --global core.autocrlf true

# 사용자 정보
## 커밋(버전 생성)을 위한 정보 등록
$ git config --global user.name 'YOUR_NAME'
$ git config --global user.email 'YOUR_EMAIL'

# 구성 확인
$ git config --global --list

 

git 버전관리 시작

$ git init

 

git 상태 확인

$ git status

 

특정파일 변경사항 추적을 지정

모든 변경사항 추적을 지정

$ git add index.html
$ git add .

 

메세지와 함께 버전 생성

$ git commit -m "프로젝트 생성"

 

origin이란 별칭으로 원격 저장소를 연결.

$ git remote add origin 주소

 

origin이란 별칭의 원격 저장소로 버전 내역 전송

$ git push origin master