[git] git 시작하기 및 기본 명령어

Ihwan Shin·2021년 1월 4일
0

git

목록 보기
1/5

git 시작하기

Initialize

git init
git remote add origin "#URL"
	# git remote -v (로 확인 가능)```

설정되어 있지 않을시

git config --global user.name "#name"
git config --global user.email "#email"

기본 명령어

Pull

git pull origin master
	# git pull == git fetch + git merge

Push

git status
	# 변경된 파일목록 불러오기
git diff "file"
	# "file"의 변경사항 불러오기
git add "file"
	# "file"을 스테이지에 올리기(.을 이용하면 변경된 전체 파일을 올림)
git commit -m "message"
	# "message"를 commit message로 남김
git push origin master
	# 원격저장소에 PUSH하기

기타

git 해제 (.git 폴더 삭제)

rm -r .git

강제 pull

git fetch --all
git reset --hard origin/master
git pull -u origin +master

profile
판교 주니어 개발자💻(since. 21/07/01)

0개의 댓글