Skip to content

Git Workflow

Haksung Jang edited this page Aug 30, 2020 · 6 revisions

Git Workflow

OpenChain-KWG 웹사이트 개발을 위한 Git Workflow를 설명합니다.

git-workflow.png

Step 1. Fork

  1. https://github.com/OpenChain-Project/OpenChain-KWG 에 방문하여,
  2. 화면 우상단의 Fork 버튼을 눌러 fork합니다.

Step 2. Clone

Fork한 repository를 Local working directory로 Clone하고, Remote에 Upstream repository를 추가합니다.

$ git clone https://github.com/[user]/OpenChain-KWG.git
Cloning into 'OpenChain-KWG'...
remote: Enumerating objects: 72, done.
remote: Counting objects: 100% (72/72), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 7794 (delta 32), reused 39 (delta 11), pack-reused 7722R
Receiving objects: 100% (7794/7794), 90.95 MiB | 9.70 MiB/s, done.
Resolving deltas: 100% (3302/3302), done.
Updating files: 100% (7313/7313), done.
 
$ cd OpenChain-KWG
$ git remote add upstream https://github.com/OpenChain-Project/OpenChain-KWG.git
$ git remote -v                                                              
origin  https://github.com/[user]/OpenChain-KWG.git (fetch)
origin  https://github.com/[user]/OpenChain-KWG.git (push)
upstream    https://github.com/OpenChain-Project/OpenChain-KWG.git (fetch)
upstream    https://github.com/OpenChain-Project/OpenChain-KWG.git (push)

Step 3. Fetch and Rebase

(Clone후 시간이 지난 시점이라면) fetch했을때 upstream에 변경 사항이 있을 경우 경우 rebase하여 master branch를 최신 상태로 유지합니다.

$ git fetch upstream
$ git checkout master
$ git rebase upstream/master

Step 4. 개발용 Branch 생성

개발용 Branch를 생성합니다.

$ git checkout -b develop

Step 5. Commit

수정 사항을 반영 후 Commit 합니다. commit message는 가능한 자세히 작성하세요.

$ git add .
$ git commit

Step 6. Push

생성한 commit을 origin의 develop branch에 push합니다.

$ git push -f origin develop

Step 7. Create a Pull Request

GitHub 사이트로 가서 Pull Request를 생성합니다. 이때 Upstream repository의 develop branch로 Create Pull Request하여 수정사항을 제출합니다.

소스 코드 다운 로드

OpenChain KWG 웹사이트의 소스 코드는 위의 GitHub WorkflowStep 1부터 Step 4까지 수행하여 다운로드 하세요.

수정 사항 제출 (Pull Request)

OpenChain KWG 웹사이트의 소스 코드 추가/수정한 이후에는 위의 GitHub WorkflowStep 5부터 Step 7까지 수행하여 제출(Pull Request)하세요.