Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. # Git Workflows
  2.  
  3. ## What is Git Workflow?
  4.  
  5. * Git is a version control system that helps software teams manage changes to source code over time.
  6.  
  7. * Git is very popular in software development because of its tree like structure
  8.  
  9. - Ability to branch off the master source code and work on that branch without affecting the master source code.
  10.  
  11.  
  12. * A git workflow is the standard convention that all team members will follow when using Git.
  13.  
  14. - This will help the team be consistent and productive during the lifecycle of the project.
  15.  
  16. ## Feature Branch Workflow
  17.  
  18. * Utilize the Git branching system where any new development could be written on a new branch without affecting master source code.
  19.  
  20. * Pros
  21. - Keeps master source code stable
  22.  
  23. - Multiple developers can work on different features without disturbing master.
  24.  
  25. - Promotes collaboration with team members through pull requests and merge reviews before merging into master source code.
  26.  
  27. * Cons
  28.  
  29. - Long lived branches have a higher risk of merge conflicts
  30.  
  31. ## The Gitflow Workflow
  32.  
  33. * Builds upon the Feature Branch workflow with the main concept of having sub-master branches.
  34. - These sub-master branches have a very specific purpose(features) but are tied to a development branch.
  35.  
  36. - The master branch is only used for deploying the final version code.
  37.  
  38. - Once the development branch have been tested and ready for production, it will be merged into master with a new version code.
  39.  
  40. * Pros
  41. - Ideal for projects with scheduled release dates
  42.  
  43. - Isolated feature development
  44.  
  45. * Cons
  46. - A lot of merge conflicts
  47.  
  48. - If there's multiple versions, it takes time to maintain the code
  49.  
  50. ## Fork & Merge Workflow
  51. * Rather than everyone working off the same centralized repo, every developer gets their own server-side repo to work on.
  52.  
  53. * Typically you’ll have two remotes with this workflow, one for your forked version and one for the primary repo.
  54. - By convention, yours will be named origin and the main will be called upstream.
  55.  
  56. - Having an upstream means you can keep your copy of the repo up to date with the latest from the primary, while continuing to work on your changes.
  57.  
  58. * Pros
  59. - Keeps primary repository clean
  60.  
  61. - Limits who has access to master source code
  62.  
  63. * Cons
  64. - More complicated than other workflows
  65.  
  66. ## Rebase Workflow
  67. * Process of moving a branch with commits to the front of master.
  68.  
  69. * Pros
  70. - Keeps everyone's commits linear for readability
  71.  
  72. * Cons
  73. - Chance to erase someone's code on public branches.
  74.  
  75.  
  76. ## Rebase vs. Merge Workflows
  77.  
  78. * Rebase: Readable git history but dangerous to rewrite git commits
  79.  
  80. * Merge: Traceable git history but can be messy
  81.  
  82.  
  83. ## The Best Git Workflow
  84.  
  85. In the end, it really depends on the company's git workflow conventions. But if you have the choice, the best Git workflow is where everyone on the team agrees to follow and stick with. If someone goes against the workflow, it will most likely cause many issues along the way.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement