Top Banner
團團團團 Git tips and flow Bo-Yi Wu 2016.04.21 1
52

Git flow 與團隊合作

Apr 12, 2017

Download

Software

Bo-Yi Wu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Git tips and flow

Git tips and flowBo-Yi Wu2016.04.211

http://blog.wu-boy.com/https://github.com/appleboyhttps://www.facebook.com/appleboy462

Git Git 3

4

5

Git flow Git 6

7

Main BranchDevelopMasterProduction 8

Support branchFeature develop merge developRelease release develop bugs merge develop masterHotfix bugs master Merge develop master9

Git flow https://goo.gl/XIThFY10

Branch11

branch merge branch Conflict12

Git flow Branch merge master develop? (Merge )13

PM: ProductionRD: Merge Master( Merge?)

14

15

Github Flow16

Branch Master Branch Master 17

Github master branch Pull RequestReview Pull Request Merge

18

Github Flow Master git push origin master f master f Code Review Merge branch branch19

20

21Github Flow

Production git tag release production22

Hotfix Tag productiongit checkout b hotfix 1.0.0git commit a m xxxxgit tag a 1.0.1 m 1.0.1git checkout mastergit cherry-pick commit-id

Master productiongit commit a m xxxxgit tag a 1.0.1 m 1.0.123

24

Commit A

Commit B

Tag productiongit cherry-pick patch-1

Git

25

Git commit ( 50 ) Issue Track Systemjira, github, redmine What, Why and How Issue Track commit fix typo, update readme 26

27

Code Review Production coder reviewer 28

29git commit a m fix typogit commit a m update readmegit commit a m fix typo

Git loggit commit a m fix typo 1git commit a m fix typo 2git commit a m fix typo 3git commit a m fix typo 4git commit a m fix typo 5git commit a m fix typo 6

30

31

https://github.com/h5bp/Front-end-Developer-Interview-Questions/pull/241/commits

Merge Master squash your commit.32

Two way to squash your commitGit reset ()Git rebase ()33

git resetgit reset --soft HEAD^ commit commit messagegit reset --hard HEAD^ () commit commit 34

34

Demo

35

git rebase i commitID-i 36

37

38

commit log master merge branch39

Two way to merge mastergit merge mastergit rebase master40

41

git log --date-order

42

git log --topo-order

43

commit Log commit log 44

branch git pull --rebase origin master45

Demo

46

Git diff diff-so-fancyhttps://github.com/so-fancy/diff-so-fancy47

48

Git tips

49

commit git reflog50

51

Any Question?

52