공개된 Source Code, 참여(기획, 의도가 함께 논의되고 의사결정이 이루어져야함)와 문서(메뉴얼, 소스코드, 패치)가 동반되어야 함 c.f. (참여가 불가능함) Android, Tizen / (관리가 되지 않음) 공개 SW 대회
한 사람이 모든 사용자 환경에서 test하고, 문서화, 번역을 할 수가 없음.
- (개인) 코딩 능력을 검증하기 위함
- (기업) 사용자를 늘리기 위함 - 확산
- (구글) white paper로 시작된 같은 프로젝트, map reduce < hadoop / Bigtable < Hbase / Google Code Search < Sourcegraph / Borg < Docker / TensorFlow (먼저 오픈소스로 만듦)
- 서버에서는 저장하고, 컴퓨터(클라이언트)에만 저장함.
- 인터넷이 안되면 작업이 되지 않음.
- Branch도 불가능함.
- 숫자로 관리
- 분산해서 저장함. (여러 군데 모두 저장함)
- 오프라인에서도, commit, branch가 자유로움
- hash (난수)로 순번을 붙임, 단 부모 값을 기록함. (GitHub에서는 7개 값만 작성함)
- Local > stage > repository 의 순서로 commit이 됨. stage는 임시저장소 같은 역할 (개발 중에 다른 branch의 개발 상태를 확인해야할 때, 현재 개발 중인 것을 stage에 올린 후 다른 branch의 내용을 실행 시키면, 추가 개발되기 이전의 version으로 확인이 가능함.)
c.f.
- GitHub은 git을 웹으로 서비스하는 것.
e.g. There are some other examples for usage
Things to aware while creating new repository:
gitignore
: GitHub에서 버전 관리 하지 않을 것들 (java면 java라고 할것)license
: MIT- create
README.md
There are some pointers to mark where you are at (aka mark version):
- origin: GitHub
- origin/HEAD: Current GitHub status
- HEAD: Current Local status
- master: Branch
If there is a CONFLICT
developer must manually merge code (3-WAY MERGE
). Git will automatically merge between each sides (most case) or saves (refers) their ancestor if there is no such difference between branches (FAST MERGE
).
Rolling back to previous working version by moving HEAD
pointers
When developers co-operate a project, there will be various revision from all over the part, then it would be difficult to track the difference between versions and where it starts from. Hence, developers make various branch to control each version's ancestor (aka parent)!
c.f.
- Git w/ CLI is skipped (push and pull using terminal)
- Refer to https://git-scm.com/book/ko/v2
There are two important methods to communicate between developers - writing and drawing
To write documents neatly on GitHub, we need to learn how to write using markdown grammar.
Here are some references for markdown grammar:
There are some editors for markdown documents:
Please refer to this program Balsamiq.
Issue is a place where other developers can share their thoughts or issues regarding codes on the repository. Moreover, people can ask and answer on the projects on this sub-menu.
c.f. There are more functions as follows:
- Label
- Milestones
e.g. Here are some good usage examples on issues:
Getting the most latest version from GitHub
c.f. Difference between PULL
and FETCH
on Sourcetree program:
FETCH
is to check the updated files from the origin (mark files that requires pulling action)PULL
is to update your client from the origin (real change happens)
Developer mainly use DEVELOP
and MASTER
branch to keep the MASTER
branch neat.
Depend on its situation, team can make additional branches as follows:
FEATURE
brach is to let some team member to in charge of specific function/part of the whole code, usually make name as iss## or [name_of_the_feature]-branchHOT-FIXES
branch is for URGENT TASK, which should be merge toDEVELOP
branch ASAP to update the urgent issues (usually security issues)RELEASE
branch
There are two different kinds of merge:
Fast merge
happens when branch can be merge directly to the master branch. This merge just saves the address of the branch rather making additional file.3-way merge
happens when each branch (master and develop) modified separately so that previous master, latest master, and final develop branch must be referred to merge into one single code.
When both codes are modified the same line/part of their ancestor from two(or more) files Conflict
occurs.
Hence developer MUST manually merge the files and CLICK '(re)solve' button, to let GitHub know that the conflict issue is closed.
To copy the other's repository to your GitHub use Fork
. This can be used as following reasons:
-
to see the contribution or importance of the project in developing society.
-
to contribute on other projects. Unless you cannot edit any of the project which you are not committer.
c.f.
- Remote pull
This method is used to avoid conflict between original repository and your forked repository. Conflict may occur if you send pull request from your forked repository after the original one is updated.
Add original repository (what you forked) as origin repository (SourceTree > Setting > Remote > add
). Then your SourceTree would pull the changes from your own repository AND original one when you click FETCH
or PULL
. Hence, your local client (aka computer) can download the latest version from the original repository.
This procedure is required to verify the code of pull request, before reading the code line by line. This can save your time when you manage a huge Open Source Project where a lot of developer wants to join in.
Following services are useful in terms of unit test:
Travis CI
: build various types of user environment where you can test and build your programCode Coverage
: calculate the coverage of test case on a whole code, so that you can check how much does the test case can cover the new pull request program.
c.f.
- BE AWARE to provide TEST CASE:
when you add a new function on the project via pull request. This requires additional (kind of) function to call your newly developed function. Otherwise your pull request would be rejected.