Git-flow 사용 노트
13022 단어 git
간단하게 말하면git-flow는
git branch
git tag
를 바탕으로 봉인된 코드 지점 관리 모델로 실제 개발을 시뮬레이션master
develop
feature
release
hotfix
support
master
몇 가지 장면으로 만들었는데 그 중에서 develop
는 출시되고 git branch
는 개발에 대응하며 다른 몇 가지는 서로 다른 상황에서 나타난다.봉인을 통해git-flow는 git branch
등 상대적으로 복잡하고 딱딱한 명령(develop
을 차단했고 특히 다분지 상황에서) 간단하고 규범화된 코드 분지 관리 문제를 해결했다.git-flow를 설치합니다.
1
brew install git-flow
새 디렉토리에 git-flow 모델을 구축합니다.
1
2
3
4
5
6
7
8
9
10
11
12
➜ git flow init Initialized empty Git repository in /Users/fannheyward/flowTest/.git/ No branches exist yet. Base branches must be created now. Branch name for production releases: [master] Branch name for "next release" development: [develop] How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? []
또는 기존 버전 라이브러리에서 작성:
1
2
3
4
5
6
7
8
9
10
11
12
➜ git flow init Which branch should be used for bringing forth production releases? - master Branch name for production releases: [master] Branch name for "next release" development: [develop] How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? []
중간에 생성된 지점 이름을 물어보고 바로 차로 돌아갑니다. 기본값입니다.이러한git-flow 분지 모델이 초기화되어 완성됩니다.
사용 장면1: 새로운 기능 개발, 대명 f1
1
2
3
4
5
6
7
8
9
10
➜ git flow feature start f1 Switched to a new branch 'feature/f1' Summary of actions: - A new branch 'feature/f1' was created, based on 'develop' - You are now on branch 'feature/f1' Now, start committing on your feature. When done, use: git flow feature finish f1
git-flow는
feature/f1
지점에서 새로운 지점 commit
을 만들고 이 지점 아래로 자동으로 전환합니다.그리고 f1기능 개발을 할 수 있고 중간에 여러 번feature/f1
조작을 할 수 있다.기능이 완료되면 다음을 수행합니다.1
2
3
4
5
6
7
8
9
➜ git flow feature finish f1 Switched to branch 'develop' Already up-to-date. Deleted branch feature/f1 (was 7bb5749). Summary of actions: - The feature branch 'feature/f1' was merged into 'develop' - Feature branch 'feature/f1' has been removed - You are now on branch 'develop'
develop
분기의 코드는 develop
에 통합된 다음에 이 분기를 삭제하고 develop
로 전환합니다.여기까지, 새로운 기능 개발이 완료되었습니다.f1기능 개발에서 만약에 f1이 완성되지 않으면 동시에 기능 f2를 시작해도 된다.사용장면2: 출시, 번호 0.1
1
2
3
4
5
6
7
8
9
10
11
12
13
➜ git flow release start 0.1 Switched to a new branch 'release/0.1' Summary of actions: - A new branch 'release/0.1' was created, based on 'develop' - You are now on branch 'release/0.1' Follow-up actions: - Bump the version number now! - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '0.1'
git-flow는
release/0.1
지점에서 새로운 지점master
을 만들고 이 지점 아래로 전환합니다. 다음은 버전 번호 수정 등 발표 작업입니다.완료 후:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
➜ git flow release finish 0.1 Switched to branch 'master' Merge made by the 'recursive' strategy. f1 | 1 + version | 1 + 2 files changed, 2 insertions(+) create mode 100644 f1 create mode 100644 version Switched to branch 'develop' Merge made by the 'recursive' strategy. version | 1 + 1 file changed, 1 insertion(+) create mode 100644 version Deleted branch release/0.1 (was d77df80). Summary of actions: - Latest objects have been fetched from 'origin' - Release branch has been merged into 'master' - The release was tagged '0.1' - Release branch has been back-merged into 'develop' - Release branch 'release/0.1' has been deleted
git-flow는 순서대로
develop
release/0.1
에서 합병git tag
의 수정을 전환한 후 git tag
로 이번 발표에 tag 0.1을 표시하고 master
를 통해 모든 tag를 볼 수 있습니다.1
2
3
➜ git:(master) git tag 0.1 0.2
사용 장면3: 긴급 버그 수정, 대명 버그1
1
2
3
4
5
6
7
8
9
10
11
12
13
➜ git flow hotfix start bug1 Switched to a new branch 'hotfix/bug1' Summary of actions: - A new branch 'hotfix/bug1' was created, based on 'master' - You are now on branch 'hotfix/bug1' Follow-up actions: - Bump the version number now! - Start committing your hot fixes - When done, run: git flow hotfix finish 'bug1'
git-flow는
hotfix/bug1
지점에서 새로운 지점 master
을 만들고 이 지점 아래로 전환합니다.다음은 버그를 복구하는 것입니다. 완료 후:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
➜ git flow hotfix finish bug1 Switched to branch 'master' Merge made by the 'recursive' strategy. f1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Switched to branch 'develop' Merge made by the 'recursive' strategy. f1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Deleted branch hotfix/bug1 (was aa3ca2e). Summary of actions: - Latest objects have been fetched from 'origin' - Hotfix branch has been merged into 'master' - The hotfix was tagged 'bug1' - Hotfix branch has been back-merged into 'develop' - Hotfix branch 'hotfix/bug1' has been deleted
git-flow는 순서대로
develop
hotfix/bug1
지점에서 합병hotfix/bug1
으로 전환하고 삭제feature
한다.여기까지hotfix가 완성되었습니다.git-flow의
release
develop
는 모두 hotfix
지점에서 창설되었고 support
master
지점에서 창설되었다.출처:http://fann.im/blog/2012/03/12/git-flow-notes/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Heroku H10/503 오류 해결 방법 - 이야기오후 2시 30분까지 내 이해 수준에 따라 배포할 준비가 된 내 코드 를 완성했습니다. 몇 달 전에 플랫폼에 Node.js 앱을 배포하여 을 따르기로 결정했습니다. How to solve Heroku H10 erro...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.