git 사용법

no minho·2023년 9월 4일
post-thumbnail

로컬 저장소에 저장

  1. github(https://github.com/)에서 계정생성

  2. 새로운 repository 생성

  3. git 다운로드

  4. git config --global user.name 아이디
    user.email 이메일
    user.password 토큰

(+ git config --list 확인)
(+ 토큰 할때 repo권한 확인)

  1. 프로젝트 폴더로 이동

  2. git init (맨 처음 프로젝트를 올리기 위해)

  3. git add . (git add: 어떤 파일을 올릴지 찾아보겠다 & . : 모든 파일을 올리겠다. )

(+ git status (상태를 알려주는 명령어, 필수x))

  1. git commit -m "first commit" (히스토리를 만드는 것)

원격 저장소에 저장

  1. git remote add origin https://github.com/xxxxx/xxxxxxx.git (로컬 프로젝트랑 깃허브를 연결)

(+ git remote -v (연결주소 확인))
(+ git remote remove origin (현재 연결된 주소 끊기))

  1. git push -u origin main

0개의 댓글