git 명령어들

YoungJoon Suh·2022년 5월 16일
0

git init: 폴더를 깃 저장소로 초기화하는 명령어.
git remote add origin git@github.com:codestates/whatever_discussion.git:
origin을 뒷 스트링과 일치시키는 명령어
git remote -v: remote repository와 연결된 branch들의 목록을 보는 명령어
git pull <원격 저장소 이름> <원격 저장소에서 받아오고자 하는 브랜치 이름>
git branch: branch들의 목록을 보여줌.
git branch -m master main: 브랜치 이름을 master에서 main으로 바꿔줌.
git push origin main: local 저장소에 branch main을 원격 저장소에 있는 origin 브랜치로 푸시시켜준다.
git checkout 브랜치이름: 그 특정한 브랜치로 바꾼다.
git branch -r: 리모트 브랜치의 목록을 보여줌.
git remote -v: 원격 저장소의 목록을 보여줌.
git remote update: 리모트 브랜치를 최신의 상태로 업데이트 시킴.
git branch -r: 로컬 레포지토리에 연결된 리모트 레포지토리의 목록을 보여줌.
git push origin --delete master: 로컬에 있는 master 브랜치를 제거한다.
git branch -r: master 브랜치가 제거된 상태로 로컬 레포지토리에 연결된 리모트 레포지토리의 목록을 보여줌.
git push origin --delete mybranch: 로컬에 있는 mybranch를 제거한다.
git branch -r: mybranch 브랜치가 제거된 상태로 로컬 레포지토리에 연결된 리모트 레포지토리의 목록을 보여줌.
git branch: 현재 local에 있는 branch목록을 보여준다.
git checkout -t upstream/dev: 기존에 있던 로컬에 있는 dev 브랜치를 리모트의 upstream 브랜치와 연결시킨후 dev로 전환한다.
git push origin dev: 로컬에 있는 dev 브랜치를 원격 저장소에 있는 origin으로 push 시킨다.
git checkout main: 로컬에 있는 main 브랜치로 전환시킨다.
git pull upstream main: 원격 저장소 upstream에서 로컬에 있는 main으로 끌어온다.

  1. 처음 폴더를 하나 만든 후 그 폴더에 진입해서 git init 시킨다. (git 저장소를 초기화 시킨다.)
  2. master(upstream)저장소에서 나의
profile
저는 서영준 입니다.

0개의 댓글