Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. Git is a SCM (source code management) in software development.
Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development. Its current maintainer since 2005 is Junio Hamano.
Three main workflows of git
When we are using git there are three main workflows that can be adopted.
- Centralized workflow
- Feature Branch Workflow
- Gitflow workflow
The most popular workflow among developers and the entry stage of every project.
The idea is quite simple. There is only one central master repository. Each developer clones the repository works locally on the code makes a commit with changes, and push it to the central master repository for other developers to pull and use in their work.
2. Feature Branch workflow:-
In feature branch workflow user create feature wise branch. This useful when you want to do some experiment. After complete development of that code user can then merge the code to the final branch. Branches are independent “tracks” of developing a project. For each new feature, a new branch should be created, where the new feature is developed and tested. Once the feature is completed and ready to live, the branch can be merged into the master branch.
3. Gitflow workflow:-
In this type, a user takes advantage of git branching. This is somehow similar to a feature branch workflow but there are some differences. In this type, a user creates the branch based on the software development lifecycle. Like separate branches for features once all the features are ready then merge those feature branch inside the development branch once everything is verified and tested then merge that branch to release branch or some SIT branch. Or we can create them based on the product version as well.
The above is a simple example. This, not a mandatory to workflow as it is.
You can customize the workflow based on project requirement, team size and team expertise using the git and teams fine grain structure. For my personal project, I use a centralized workflow. For large enterprise project and in CI and CD implementation scenario people prefer the git-flow workflow.
So which approach do you choose? and Why? Let me know in comments.