Skip to content

OurGitFlowProcess

gabriellesc edited this page Aug 26, 2017 · 1 revision

Our team gitflow process

We created a github repository in which we ran through a hotfix, feature and release.

https://github.com/jmzaleski/gitflow-process-illustration

A git repo is a graph, right? So it is best illustrated with a graph, a google drawing will have to do, this one with links to commits and PR's in the github repo above.

google drawing of branch diagram

"published" rendering of above

Note: some of the comments on some of the commits are bad. (a couple of "update source.c" messages) I was tricked by the github UI a few times. When I get a chance, I'll clone to a new repo, and follow https://help.github.com/articles/changing-a-commit-message/ to fix.

Recipe for above

  1. create repo, hence master branch
  2. create initial v0.0 source.c and version.h
  3. create hotfix branch h1 off master for first hotfix
  4. commit first hotfix to source.c commit: a86df9c
  5. create [hotfix] PR#1 proposing to merge h1 to master. PR name should begin with [hotfix]
  6. create feature branch f1 off development
  7. commit first feature to source.c commit: 1682319
  8. create [feature] PR#2 proposing to merge f1 into development. PR name should begin with [feature]. 1.merge hotfix PR#1 to master
  9. merge feature PR#2 to development
  10. create [sync-hotfix] PR#3 proposing to merge h1 to development. PR name should begin with [sync-hotfix]
  11. merge PR#3
  12. create first release branch r1 off development
  13. commit bump of version number in version.h fcb587
  14. create [release] PR#4 proposing to merge r1 to master. PR name should begin with [release].
  15. create [sync-release] PR#5 proposing to merge r1 to development. PR name should begin with [sync-release]
  16. merge PR#4 to master
  17. merge PR#5 to development

screen shot of closed github PRs when done

screen shot of github's PR view

screen shot of github commit history when done

I missed a few of the commit messages. (Update source.c should have been something more descriptive). Also, I messed the commit message for PR #1. Should have had the prefix [hotfix]

screen shot of github's commit log

short git log for above

I goofed a few of the commit messages. (I did the whole exercise using the github UI.) I'm not sure what happened, but I think I might have typed the commit message into a comment box. Anyways, there are a couple of generic "update source.c" messages that should be more descriptive, eg: "implement f1". Similarly, I missed the prefix in the name of PR

I think the religious war between rebase and merging PR's is motivated by the opacity of the merge commits vs the clarity of when the big things land.

Commits in HEAD
90908ec *   (HEAD -> refs/heads/master, refs/remotes/origin/master, refs/remotes/origin/HEAD) [release] Merge pull request #4 from jmzaleski/r1
        |\  
fcb58f7 | * origin/r1 r1 bump version to 1.0
5a91ce3 | *   [sync-hotfix] Merge pull request #3 from jmzaleski/h1
        | |\  
82f44c7 | | *   origin/h1 h1 Merge branch 'development' into h1 
        | | |\  
        | | |/  
        | |/|   
17d28ae | * |   [feature] Merge pull request #2 from jmzaleski/f1
        | |\ \  
1682319 | | * | origin/f1 Update source.c **** bad commit message: should read implement feature 1
        | |/ /  
5411a56 * | |   Merge pull request #1 from jmzaleski/h1 *** bad PR comment: should have [hotfix] prefix
        |\ \ \  
        | |/ /  
        |/| /   
        | |/    
a86df9c | * Update source.c
        |/  
d9f4093 * Create source.c
eccb0f6 * Create version.h
83a3d29 * Update README.md
55b21db * commentary

git log for above

Commits in HEAD
        *   commit 90908ec (HEAD -> refs/heads/master, refs/remotes/origin/master, refs/remotes/origin/HEAD)
        |\  Merge: 5411a56 fcb58f7
        | | Author: Mathew Zaleski <[email protected]>
        | | Date:   Thu Aug 24 11:34:36 2017 -0400
        | | 
        | |     [release] Merge pull request #4 from jmzaleski/r1
        | |     
        | |     [release] deploy r1
fcb58f7 | * origin/r1 r1 
        | | Author: Mathew Zaleski <[email protected]>
        | | Date:   Thu Aug 24 11:30:28 2017 -0400
        | | 
        | |     bump version to 1.0
        | | 
        | |  version.h | 2 +-
        | |  1 file changed, 1 insertion(+), 1 deletion(-)
5a91ce3 | *   
        | |\  Merge: 17d28ae 82f44c7
        | | | Author: Mathew Zaleski <[email protected]>
        | | | Date:   Thu Aug 24 11:25:33 2017 -0400
        | | | 
        | | |     [sync-hotfix] Merge pull request #3 from jmzaleski/h1
        | | |     
        | | |     [sync-hotfix] Update source.c
        | | |     
        | | |     conflict resolved  manually, using github conflict editor
82f44c7 | | *   origin/h1 h1 
        | | |\  Merge: a86df9c 17d28ae
        | | |/  Author: Mathew Zaleski <[email protected]>
        | |/|   Date:   Thu Aug 24 11:24:29 2017 -0400
        | | |   
        | | |       Merge branch 'development' into h1
17d28ae | * |   
        | |\ \  Merge: d9f4093 1682319
        | | | | Author: Mathew Zaleski <[email protected]>
        | | | | Date:   Thu Aug 24 11:20:30 2017 -0400
        | | | | 
        | | | |     [feature] Merge pull request #2 from jmzaleski/f1
        | | | |     
        | | | |     [feature] implement f1
1682319 | | * | origin/f1 
        | |/ /  Author: Mathew Zaleski <[email protected]>
        | | |   Date:   Thu Aug 24 11:10:30 2017 -0400
        | | |   
        | | |       Update source.c
        | | |   
        | | |    source.c | 1 +
        | | |    1 file changed, 1 insertion(+)
5411a56 * | |   
        |\ \ \  Merge: d9f4093 a86df9c
        | |/ /  Author: Mathew Zaleski <[email protected]>
        |/| /   Date:   Thu Aug 24 11:18:42 2017 -0400
        | |/    
        | |         Merge pull request #1 from jmzaleski/h1
        | |         
        | |         [hotfix]  h1
a86df9c | * 
        |/  Author: Mathew Zaleski <[email protected]>
        |   Date:   Thu Aug 24 11:07:28 2017 -0400
        |   
        |       Update source.c
        |   
        |    source.c | 1 +
        |    1 file changed, 1 insertion(+)
d9f4093 * 
        | Author: Mathew Zaleski <[email protected]>
        | Date:   Thu Aug 24 11:05:42 2017 -0400
        | 
        |     Create source.c
        | 
        |  source.c | 1 +
        |  1 file changed, 1 insertion(+)
eccb0f6 * 
        | Author: Mathew Zaleski <[email protected]>
        | Date:   Thu Aug 24 11:05:00 2017 -0400
        | 
        |     Create version.h
        | 
        |  version.h | 2 ++
        |  1 file changed, 2 insertions(+)
83a3d29 * 
        | Author: Mathew Zaleski <[email protected]>
        | Date:   Thu Aug 24 10:59:46 2017 -0400
        | 
        |     Update README.md
        | 
        |  README.md | 28 ++++++++++++++++++++++++++++
        |  1 file changed, 28 insertions(+)
55b21db * 
         Author: Mathew Zaleski <[email protected]>
         Date:   Thu Aug 24 10:58:53 2017 -0400
         
             commentary
         
          README.md | 2 ++
          1 file changed, 2 insertions(+)