[git] 자주쓰는 명령어


Git 자주쓰는 명령어 정리


init   
fork   
clone   
git 기본 git config –listgit 정보 조회
remoteGit remote 저장소git remote리모트 저장소 확인
  git remote -v 
  git remote rename A B리모트 저장소 이름 변경
  git remote remove A리모트 저장소 삭제
branch   
fetch저장소에서 데이터 가져오기 (로컬 데이터에 merge 안함)git fetch  
pull저장소에서 데이터 가져오고 로컬과 mergegit pull 
pushUpstream 저장소에 push (단 upstream을 가져와 merge 한 후에만 가능)git push <리모트저장소> <브랜치 이름=""> 
add commit push git add {source}
git commit -m “커밋 메시지”
git push
 
statusadd 된 내역 확인git status 
logcommit 이력확인git log커밋 이력보기
  git log –oneline한줄로 요약해서 보기
resetstaging 취소git resetstaging 취소
  git reset –hardstaging 취소
working directory 까지도 변경전 상태로 되돌림 (변경 내용 소멸)
rebasecommit을 하나의 commit으로 정리  
   


Git 영역

  • Working Directory (Local) : 개인 코드 작성

  • Staging 영역 : git add 를 통해서 수정된 코드를 올리는 영역

  • Repository : git commit 을 통해서 최종 수정본을 제출






© 2021. by tytybro

Powered by tytybro