
git의 설치가 완료 되었다면, version을 확인한다.
git --version
name & email setting
git config --global user.name "이름"
git config --global user.email "이메일"
설정한 name 과 email을 확인할 수 있다.
git config user.name
git config user.email
git init : Initializing a repository
👉 터미널에서 프로젝트 폴더로 이동 후 이 명령어를 입력하면 폴더에 .git 숨김파일이 형성되고, 이 디렉토리에 대해서 git이 변경사항 추적이 가능하게 된다. 즉, git을 사용하려면 해당 프로젝트의 디렉토리에서 git init 명령어로 시작해야한다.
git status : git 저장소에 있는 파일들의 상태를 확인할 수 있다.
git add . : working directory에서 작업한 파일을 staging area로 올리는 명령어
git add 파일명(ex. test.py) : 특정 파일만 올릴 수도 있다.
git rm --cached* : staging area의 파일을 working directory로 내리는 명령어
git commit -m "commit message" : staging area로 add한 파일을 git directory로 commit한다. 커밋메시지를 함께 남길 수 있다.
git log : 히스토리 조회
git branch branch명 : branch 생성
git checkout branch명 : 생성한 branch로 이동
git branch -D branch명 : branch 삭제
git remote add origin "github repository주소" : git directory와 원격 저장소(github) repository을 연결한다.
git remote : 현재 프로젝틍 저장된 리모트 저장소를 확인
git push -u origin master : 원격 저장소(github repository)로 업로드