uncategorized

git-flow

date: 2019-02-07 18:38:24

์„ค์น˜

๊ธฐ์กด git ์ €์žฅ์†Œ ๋‚ด์—์„œ ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๊ฒƒ์œผ๋กœ git-flow์˜ ์‚ฌ์šฉ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
> git flow init
Initialized empty Git repository in /Users/jake.ko/Dev/git-flow-test/.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? []
>
>ll
total 0
drwxr-xr-x 25 jake.ko staff 800 2 7 18:01 ..
drwxr-xr-x 3 jake.ko staff 96 2 7 18:36 .
drwxr-xr-x 13 jake.ko staff 416 2 7 18:36 .git

๋ช‡๋ช‡ ์งˆ๋ฌธ์— ๋Œ€๋‹ตํ•ด์„œ ๋ธŒ๋žœ์น˜์˜ ๋ช…๋ช…๊ทœ์น™์„ ์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ๊ฐ’์„ ์‚ฌ์šฉํ•˜๊ธฐ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

์ƒˆ ๊ธฐ๋Šฅ ์‹œ์ž‘

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
> git flow feature start MYFEATURE
Switched to a new branch 'feature/MYFEATURE'

Summary of actions:
- A new branch 'feature/MYFEATURE' was created, based on 'develop'
- You are now on branch 'feature/MYFEATURE'

Now, start committing on your feature. When done, use:

git flow feature finish MYFEATURE

> git status
On branch feature/MYFEATURE
nothing to commit, working tree clean

> echo 'my feature' > myfeature.txt
> git add .
> git commit -m"add myfeature"

๊ธฐ๋Šฅ ์™„๋ฃŒ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  feature/MYFEATURE ๎‚ฐ git flow feature finish MYFEATURE
Switched to branch 'develop'
Updating f68a50c..102c09d
Fast-forward
myfeature.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 myfeature.txt
Deleted branch feature/MYFEATURE (was 102c09d).

Summary of actions:
- The feature branch 'feature/MYFEATURE' was merged into 'develop'
- Feature branch 'feature/MYFEATURE' has been removed
- You are now on branch 'develop'

jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ ll
total 8
drwxr-xr-x 25 jake.ko staff 800 2 7 18:01 ..
drwxr-xr-x 4 jake.ko staff 128 2 7 20:46 .
-rw-r--r-- 1 jake.ko staff 11 2 7 20:46 myfeature.txt
drwxr-xr-x 14 jake.ko staff 448 2 7 20:47 .git

๊ธฐ๋Šฅ์„ ๊ฒŒ์‹œ(publish)

1
โœ˜ jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ git flow feature publish MYFEATURE

๊ฒŒ์‹œ๋œ ๊ธฐ๋Šฅ ๊ฐ€์ ธ์˜ค๊ธฐ

1
โœ˜ jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ git flow feature pull origin MYFEATURE

๋ฆด๋ฆฌ์ฆˆ ์‹œ์ž‘

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 โœ˜ jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ git flow release start RELEASE
Switched to a new branch 'release/RELEASE'

Summary of actions:
- A new branch 'release/RELEASE' was created, based on 'develop'
- You are now on branch 'release/RELEASE'

Follow-up actions:
- Bump the version number now!
- Start committing last-minute fixes in preparing your release
- When done, run:

git flow release finish 'RELEASE'

jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  release/RELEASE ๎‚ฐ git flow release publish RELEASE
Counting objects: 3, done.
Writing objects: 100% (3/3), 254 bytes | 254.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'release/RELEASE' on GitHub by visiting:
remote: https://github.com/kjs850/git-flow-test/pull/new/release/RELEASE
remote:
To https://github.com/kjs850/git-flow-test.git
* [new branch] release/RELEASE -> release/RELEASE
Already on 'release/RELEASE'
Your branch is up to date with 'origin/release/RELEASE'.

Summary of actions:
- A new remote branch 'release/RELEASE' was created
- The local branch 'release/RELEASE' was configured to track the remote branch
- You are now on branch 'release/RELEASE'

๋ฆด๋ฆฌ์Šค ์™„๋ฃŒ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  release/RELEASE ๎‚ฐ git flow release finish RELEASE
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Merge made by the 'recursive' strategy.
myfeature.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 myfeature.txt
Deleted branch release/RELEASE (was 102c09d).

Summary of actions:
- Latest objects have been fetched from 'origin'
- Release branch has been merged into 'master'
- The release was tagged 'RELEASE'
- Release branch has been back-merged into 'develop'
- Release branch 'release/RELEASE' has been deleted

ํ•ซํ”ฝ์Šค ์‹œ์ž‘

1
2
3
4
5
6
7
8
9
10
11
12
13
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  master ๎‚ฐ git flow hotfix start hotfix-1
Switched to a new branch 'hotfix/hotfix-1'

Summary of actions:
- A new branch 'hotfix/hotfix-1' was created, based on 'master'
- You are now on branch 'hotfix/hotfix-1'

Follow-up actions:
- Bump the version number now!
- Start committing your hot fixes
- When done, run:

git flow hotfix finish 'hotfix-1'

ํ•ซํ”ฝ์Šค ์™„๋ฃŒ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  hotfix/hotfix-1 ๎‚ฐ git flow hotfix finish hotfix-1
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Merge made by the 'recursive' strategy.
something.txt | 1 +
1 file changed, 1 insertion(+)
Switched to branch 'develop'
Merge made by the 'recursive' strategy.
something.txt | 1 +
1 file changed, 1 insertion(+)
Deleted branch hotfix/hotfix-1 (was b4e2485).

Summary of actions:
- Latest objects have been fetched from 'origin'
- Hotfix branch has been merged into 'master'
- The hotfix was tagged 'hotfix-1'
- Hotfix branch has been back-merged into 'develop'
- Hotfix branch 'hotfix/hotfix-1' has been deleted

jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ git status
On branch develop
nothing to commit, working tree clean
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  develop ๎‚ฐ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  master ๎‚ฐ git push && git push --tags
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 362 bytes | 362.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/kjs850/git-flow-test.git
47ce058..3963404 master -> master
Counting objects: 1, done.
Writing objects: 100% (1/1), 157 bytes | 157.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To https://github.com/kjs850/git-flow-test.git
* [new tag] hotfix-1 -> hotfix-1
jake.ko ๎‚ฐ ~/Dev/git-flow-test ๎‚ฐ ๎‚  master ๎‚ฐ

reference

cheatsheet

tags:

Share