오늘은 자주 쓰는 git 명령어들을 작성해보았다.
-> 로컬=origin, 원격저장소 branch=main
git 저장소 생성 `git init`
git 상태 확인 `git status`
원격저장소를 로컬로 복제 `git clone {link}`
staging area에 파일 추가 `git add {file}` / `git add .`
git에 commit `git commit -m "{message}"`
원격 저장소에 로컬 변경사항 업로드 `git push {origin} {main}`
원격 저장소 변경사항 로컬로 다운로드 `git pull`
원격 저장소 변경사항을 로컬로 가져옴 `git fetch {alias}`
github 주소와 연결 `git remote add {origin} {url}`
브랜치 생성 `git branch {branch}`
로컬 브랜치 삭제 `git branch -D {branch}`
브랜치 변경(예전 check out) `git switch branch {branch}`
브랜치 확인 `git branch`
특정 브랜치와 현재 브랜치 병합 `git merge {branch}`
사용자 이름, 이메일 설정
`git config --global user.name "{name}"`
`git config --global user.email "{email}"`
사용자 정보 확인 `git config --list`
Git - git Documentation
Various Git commands pay attention to environment variables and change their behavior. The environment variables marked as "Boolean" take their values the same way as Boolean valued configuration variables, e.g. "true", "yes", "on" and positive numbers are
git-scm.com
'알쓸신잡' 카테고리의 다른 글
[Github README 꾸미기] (0) | 2023.11.23 |
---|---|
Git pull request 및 협업 (1) | 2023.11.20 |
Git commitizen, gitmoji 사용 (1) | 2023.11.20 |
티스토리 인라인 코드블럭 (0) | 2023.11.18 |
Conventional commit (1) | 2023.11.18 |