Thursday, March 13, 2014

GitHub workflow

1. 관심있는 Project를 fork한다
  - https://github.com/sunglim/spark 식으로 repository가 생긴다

2. fork한 repository를 로컬에 다운로드한다 (clone)

3. 코딩하기전에 branch를 만든다
  git checkout -b foo

4. 브랜치에서 코딩을하고 커밋을 한다
  git commit -am "my first commit"

5. push를 한다
  git push -u origin [branchname]
 이 예제에서는 git push -u origin foo

6. github사이트로 가서 pull request 를 날린다

7. 커밋이 아마 되겠지..
  안되고 수정하라는 피드백이 오면
  로컬에 작업하던 브랜치로 가서 추가로 커밋을 한다
  push를 날리면 기존에 하던 pull request에 자동으로 추가가된다

8. 자 다 끝났다

9. upstream(fork를 해온 저장소)이 수정되었다. 내 fork 리파지토리를 업데이트하고싶다
 - git checkout master
    git fetch upsteam
    git merge upstream/master
    git push

하면 업데이트가 된다

No comments:

Post a Comment