Posts 자주 쓰는 Git Command
Post
Cancel

자주 쓰는 Git Command


자주 쓰는 Git Command

Clone

1
2
git clone {url} : 프로젝트 Clone
git clone -b {branch_name} --single-branch {저장소 URL} : 원격 저장소의 특정 branch만 clone

Branch

1
2
3
4
5
6
7
git branch {name} : name branch를 생성
git checkout {branch_name} : 특정 로컬 branch로 전환
git checkout -r {branch_name} : 특정 원격 branch로 전환
git branch -r : 원격 저장소의 branch 목록 조회
git branch -a : 로컬 저장소의 branch 목록 조회
git branch -m {current_name} {change_name} : branch 이름 변경
git branch -d {branch_name} : 특정 branch 삭제

Commit

1
2
3
4
git status : staging 현황
git add {file} : file을 staging
git add * : 변경된 모든 파일을 staging
git commit -m "": staging된 파일들을 commit

Push

1
2
3
git push : 현재 branch를 push
git push {branch_name} : 로컬 저장소의 특정 branch에 push
git push {remote_name} {branch_name} : 원격 저장소의 특정 branch에 push

Pull/fetch

1
2
3
4
git pull : 현재 branch의 변경사항 가져오기
git fetch {remote_name} : 원격 저장소의 변경사항 가져오기
git pull {remote_name} {branch_name}: 원격 저장소 특정 branch와 merge 방식으로 병합
git pull --rebase {remote_name} {branch_name} : 원격 저장소 특정 branch와 rebase 방식으로 병합

Repository

1
git init : 새로운 저장소 생성

Remote

1
git remote add origin 링크 : 원격 저장소를 설정
This post is licensed under CC BY 4.0 by the author.

Vim 명령어

ROS Mater, Slave Setting