TOP -> BOTTOM : github에서 repo 생성 후
local repo(cli)에서 clone한 뒤 add/commit/github에 push
BOTTOM -> TOP : local repository(cli)에서 repo create 한 뒤
mkdir {reponame}, copy top-repo address
git init/remote/add/commit/github에 push
주로 top to bottom (clone) 방식을 자주 사용한다. (셋팅면에서 유리)
*blob의 단위는 항상 동작하는 단위로
commit의 내용은 50자내외
제목과 내용사이 한 칸
prefix(머리말)를 사용해 한 눈에 커밋용도를 알기 쉽게 한다
feat (features:기능개발)
docs (documentations:문서형식)
conf (configurations:환경설정)
test (test:테스트)
fix (bug-fix:버그수정)
refactor (refactoring:코드개선)
ci (Continuous Intergration :코드자동화)
build (부산물 등)
perf (Performance)
/ 로컬 프로젝트를 GitHub Repository에 Push하기 /
// github의 기본 branch가 기존 master -> main으로 변경되었으므로 기본 branch 설정을 main으로 해줌.
git config --global init.defaultBranch main
// 기본 branch 설정 확인
git config --get init.defaultBranch
// git project로 관리하기위한 .git을 생성해줌.
git init
// git 프로젝트의 파일 상태를 확인.
git status
// git commit할 파일을 추가해줍니다. git add 뒤에 .일 경우 모든 파일 선택.
git add .
// git 프로젝트의 파일 상태를 확인.
git status
// git commit 명령어
// git commit -m "{commit id}"
git commit -m "create project"
git branch -M main
// github repository 지정
// git remote add origin {git repository url}
git remote add origin https://github.com/herojoon/sample-project.git
// push
git push -u origin main
// GitHub Repository를 private로 생성한 경우 인증정보 입력.
// 기존에는 Password란에 GitHub Password를 입력하였으나
// 2021년 8월 13일부터 Password란에 토큰 입력으로 변경됨.
// 토큰 발급 방법은 https://herojoon-dev.tistory.com/108 참고
Username for 'https://github.com': GitHub계정 입력
Password for 'https://깃헙계정@github.com': GitHub에서 발급한 토큰정보 입력
/ 로컬 프로젝트를 GitHub Repository에 Push 완료 /