Dev/Server

gitHub 사용해 보기

마이스토리 2016. 2. 17. 15:37
1. git 설치하기
http://git-scm.com/downloads

2. git/gitHub 설정하기

- gitHub.com 에 계정생성

- git Bash 를 실행하여 타이핑. 로컬컴퓨터에 git을 사용할 준비작업
git config --global user.name "your name"
git config --global user.name "your@email.com"

3. 온라인 저장소 만들기
   gitHub.com 새로운 repository를 만든다. ( /testPrj1 )

4. 로컬 저장소 만들고 초기화
mkdir ~/gitRepo/testPrj1   (앞서 gitHub.com에서 만든 저장소와 동일한 이름으로)
cd ~/gitRepo/testPrj1
git init

5. 파일 생성하고 추가하기

touch Readme.txt

git add Readme.txt

git commit -m "add Readme.txt"

6. 로컬저장소와 깃허브 저장소 연결하기

git remote add origin https://github.com/jnj45/testPrj1

git remote -v     (원격origin에 대한 모든 항목 조회)

git push --set-upstream origin master