컴퓨터 사이언스
협업을 위한 최소한의 GIT 설정 방법
제크와 죠세핀
2020. 6. 3. 04:23
반응형
다음은 협업을 위한 최소한의 git 설정 방법이다. 아니, 협업이 아니라 혼자서 github 관리할 때에도 이 정도만 알면 일단 버틸 순 있다. (아직 마스터 브랜치만 쓸줄 암 주의)
1. 로컬에 있는 코드를 그대로 github에 올리는 방법
내 github 계정 들어가서 repository를 하나 아무거나 만든다.
로컬에서 원하는 폴더에 들어간 후
git init
git add [filename]
git commit -m [message]
git status // commit 됬는 지 확인
git remote add origin https:github.com/account_name/repo_name/git_test.git
git remove -v
git push origin master
2. github에 있는 코드를 clone하는 법
git clone https:github.com/account_name/repo_name/git_test.git
3. 내 수정사항 github에 업데이트 하는 방법
git add [filename]
git commit -m [message]
git push origin master
4. github 서버의 최신 변경사항으로 내 로컬 업데이트 하는 법
git pull origin master
꼭 브랜치 쓰는 방법도 익히자.
반응형