깃허브 초기화 하기

2016. 12. 4. 09:25Dev/Github

반응형

깃허브를 시작할시 2가지 경우 생긴다.

1. 프로젝트가 깃허브에 존재하므로 local로 가져와야 한다.

2. 프로젝트가 local에 존재하므로 깃허브로 올려준다.


2가지 경우의 공통시작은

깃허브 사이트에서 Repository를 만들어 주고 작업할 local 프로젝트 위치에서 


깃허브에서 내려받기
$ git init
$ git remote add [remote이름] [사용할 자신의 Repository 주소(SSH/HTTPS)]
$ git pull [remote이름] master


프로젝트 깃허브로 올리기
$ git init
$ git remote add [remote이름] [사용할 자신의 Repository 주소(SSH/HTTPS)]
$ git add .
$ git commit -m "초기화"
$ git pull [remote이름] master
$ git push [remote이름] master


반응형