Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Git Workflows
- ## What is Git Workflow?
- * Git is a version control system that helps software teams manage changes to source code over time.
- * Git is very popular in software development because of its tree like structure
- - Ability to branch off the master source code and work on that branch without affecting the master source code.
- * A git workflow is the standard convention that all team members will follow when using Git.
- - This will help the team be consistent and productive during the lifecycle of the project.
- ## Feature Branch Workflow
- * Utilize the Git branching system where any new development could be written on a new branch without affecting master source code.
- * Pros
- - Keeps master source code stable
- - Multiple developers can work on different features without disturbing master.
- - Promotes collaboration with team members through pull requests and merge reviews before merging into master source code.
- * Cons
- - Long lived branches have a higher risk of merge conflicts
- ## The Gitflow Workflow
- * Builds upon the Feature Branch workflow with the main concept of having sub-master branches.
- - These sub-master branches have a very specific purpose(features) but are tied to a development branch.
- - The master branch is only used for deploying the final version code.
- - Once the development branch have been tested and ready for production, it will be merged into master with a new version code.
- * Pros
- - Ideal for projects with scheduled release dates
- - Isolated feature development
- * Cons
- - A lot of merge conflicts
- - If there's multiple versions, it takes time to maintain the code
- ## Fork & Merge Workflow
- * Rather than everyone working off the same centralized repo, every developer gets their own server-side repo to work on.
- * Typically you’ll have two remotes with this workflow, one for your forked version and one for the primary repo.
- - By convention, yours will be named origin and the main will be called upstream.
- - 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.
- * Pros
- - Keeps primary repository clean
- - Limits who has access to master source code
- * Cons
- - More complicated than other workflows
- ## Rebase Workflow
- * Process of moving a branch with commits to the front of master.
- * Pros
- - Keeps everyone's commits linear for readability
- * Cons
- - Chance to erase someone's code on public branches.
- ## Rebase vs. Merge Workflows
- * Rebase: Readable git history but dangerous to rewrite git commits
- * Merge: Traceable git history but can be messy
- ## The Best Git Workflow
- 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