본문 바로가기
Tools

github 명령어 사용

by wycho 2023. 11. 13.

- LINUX에서 github와 연동하여 작업을 진행할때 필요한 명령어

 

git config --global user.name "username"
git config --global user.email user@gmail.com

git init # git 저장하거나 수정하는 폴더 지정.
git remote add origin URL # Repository 등록
git remote -v # 연동 확인

git clone URL


git pull origin # 현재 코드에 저장소 최신 파일들 merge
git fetch origin # 저장소 파일들 가져오기


git add . or git add -A # 변경내용 저장
git commit -m "name of commit"  # 변경내용 묶기
git commit -am "name of commit"  # 수정하고 commit 묶기
git push origin master #


git branch name_branch
git branch -b name_create_branch # 브렌치 생성하고 checkout
git branch -b name_create_branch source_branch # source 브렌치에서 가져와서 새 브렌치 생성하고 checkout
git branch -m old_name new_name # 브렌치 이름 바꾸기
git checkout other_branch # 다른 브렌치로 이동
git branch -v # 브렌치 정보 확인
git branch -d name_branch # 브렌치 삭제


git merge --no-ff my_branch # my_branch를 checkout한 branch에 합치고 my_branch는 없애기

 

 

Reference

- https://mylko72.gitbooks.io/git/content/

 

 

'Tools' 카테고리의 다른 글

Python 3.11  (0) 2022.11.11
PDF dark mode  (0) 2022.04.11
PBS - Workload manager  (0) 2022.03.13
Methylcheck  (0) 2022.01.20
Methylprep  (0) 2022.01.19

댓글