[TIL]Git repository

김윤혜·2022년 11월 14일
0

Git repository

  • 내 컴퓨터 -> Local Git repository -> Remote Git repository

Local repository

  1. 내 컴퓨터에 코드를 저장할 폴더 생성 : mkdir my-app touch index.html
    • 생성 폴더&파일 확인 : ls
  2. 해당 폴더에 로컬 Git repository를 생성 : git init
    • 내 컴퓨터의 폴더를 Git repository와 연결
  3. 작업공간(work space)의 내용 => staging area : git add
    • git status : staging area 확인
  4. staging area의 파일 => Local repository에 기록 git commit -m
  5. 커밋 취소 : git reset HEAD^ 커밋 확인 : git log

Remote repository

  1. Gitgub에서 새로운 Github repository 생성
  2. Local repository <=> Remote repository : `git remote add <name; 원격 리포지토리 주소를 대신할 이름>
    • 로컬&리모트 연결확인 : git remote -v
  3. Local repository & Remote repository 연결 확인 : git remote -v
  4. Local repository_commit => Remote repository_commet : `git push <remote_name> <branch_main>
profile
본질에는 일치를, 비본질에는 관용을, 이 모든 것에 사랑을

0개의 댓글