{"id":20881565,"url":"https://github.com/nahidulhasan/git-flow-example","last_synced_at":"2025-06-27T17:36:30.024Z","repository":{"id":94256085,"uuid":"216136142","full_name":"nahidulhasan/git-flow-example","owner":"nahidulhasan","description":"Git Flow Example","archived":false,"fork":false,"pushed_at":"2021-02-15T06:37:50.000Z","size":66,"stargazers_count":58,"open_issues_count":1,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-12T17:36:19.922Z","etag":null,"topics":["git","gitflow","gitflow-model","gitflow-release","gitflow-workflow"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nahidulhasan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-19T02:09:42.000Z","updated_at":"2024-10-05T00:24:44.000Z","dependencies_parsed_at":"2023-07-27T18:16:10.864Z","dependency_job_id":null,"html_url":"https://github.com/nahidulhasan/git-flow-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nahidulhasan/git-flow-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nahidulhasan%2Fgit-flow-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nahidulhasan%2Fgit-flow-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nahidulhasan%2Fgit-flow-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nahidulhasan%2Fgit-flow-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nahidulhasan","download_url":"https://codeload.github.com/nahidulhasan/git-flow-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nahidulhasan%2Fgit-flow-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262302656,"owners_count":23290303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","gitflow","gitflow-model","gitflow-release","gitflow-workflow"],"created_at":"2024-11-18T07:25:19.761Z","updated_at":"2025-06-27T17:36:30.016Z","avatar_url":"https://github.com/nahidulhasan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Flow - Why and How to use:  \n GitFlow is a collection of Git commands to define a strict branching model designed around the project release for Vincent Driessen's [branching model](http://nvie.com/git-model \"original blog post\"). \n  \nGitflow is really just an abstract idea of a Git workflow. This means it dictates what kind of branches to set up and how to merge them together. The git-flow toolset is an actual command line tool that has an installation process.Git-flow extension is a wrapper around Git.\n\n## Why should use git flow:  \n  \n- GitFlow is a collection of Git commands to provide many repository operations with just single command.  \n- It was developed to manage the branching mechanism with a standardised approach when developing features,  \n  handling releases and managing hotfixes.  \n- Using multiple separate branches in Git will provide flexibility but gets complex. This is easy in gitflow.  \n- It makes developer speed up the process with familiar branch structure.  \n - Switching branches is easy.  \n - Keep repository \u0026 process clean and tidy.  \n   \n ## Installation:  \n   \n### Setup  \n You need a working git installation as prerequisite.  Git flow works on macOS, Linux and Windows  \n   \n#### macOS  \n\n Homebrew \n \n``` $ brew install git-flow-avh  ```\n\n Macports  \n \n``` $ port install git-flow-avh ``` \n   \n#### Linux (Debian)\n \n ``` $ apt-get install git-flow  ```\n \n #### Linux (Fedora)\n \n ``` $ sudo yum install gitflow  ```\n \n \n #### Windows (Cygwin) \n  \n ```$ wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bash  ```\n   \n ### Getting started  \n Git flow needs to be initialized in order to customize your project setup.  \n   \n#### Initialize  \n After installing git-flow you can use it in your project by executing git flow init.\n \n ``` $ git flow init  ```\n \n The git flow init command is an extension   of the default git init command and doesn't change anything in your repository other than creating branches for you.  \n You'll have to answer a few questions regarding the naming conventions for your branches.  \n It's recommended to use the default values.  \n   \n ![alt text](images/initialize.png)  \n   \n   \n ### How it works  \n   \n Instead of a single master branch, this workflow uses two branches to record the history of the project. The master branch stores the official release history, and the develop branch serves as an integration   \n branch for features. It's also convenient to tag all commits in the master branch with a version number.  \n  \n  \n#### Feature Branches  \nEach new feature should reside in its own branch, which can be pushed to the central repository for backup/collaboration. But, instead of branching off of master, feature branches use develop as their parent branch. When a feature is complete,  it gets merged back into develop. Features should never interact directly with master.  \n\n##### Creating a feature branch  \n Without the git-flow extensions:  \n ```\n   git checkout develop  \n   git checkout -b feature_branch\n   ```\n When using the git-flow extension:   \n``` \ngit flow feature start feature_branch\n ``` \n   \n##### Publishing a feature branch  \n Without the git-flow extensions:  \n ```\n   git push origin feature_branch  \n   ```\n When using the git-flow extension:   \n``` \ngit flow feature publish feature_branch\n ```  \n \n Get a feature published by another user.  \n```\ngit flow feature pull origin feature_branch \n``` \n\n You can track a feature on origin by using  \n``` \ngit flow feature track feature_branch\n```  \n   \n##### Finishing a feature branch  \n When you’re done with the development work on the feature, the next step is to merge the feature_branch into develop.  \n   \n Without the git-flow extensions:   \n ```\n git checkout develop  \n git merge feature_branch  \n ```\n   \n Using the git-flow extensions:  \n  \n ```\n git flow feature finish feature_branch  \n```  \n\n#### Bugfix Branches  \nAfter finishing feature branch, if you get bug then you can create bugfix branch. Like as feature branch it will be always created from develop branch. \n\n##### Creating a bugfix branch   \n``` \ngit flow bugfix start bugfix_branch \n``` \n   \n ##### Publishing a feature branch  \n \n```\ngit flow bugfix publish bugfix_branch \n```  \n \n   \n##### Finishing a bugfix branch  \n When you’re fixed bug, the next step is to merge the bugfix_branch into develop.  \n ```\n git flow bugfix finish bugfix_branch  \n```   \n   \n#### Release Branches  \n  \n Creating this branch starts the next release cycle, so no new features can be added after this point—only bug fixes, documentation generation, and other release-oriented tasks should go in this branch. Once it's ready to ship, the release branch gets merged into master and tagged with a version number.   \n \n ##### Creating a release branch   \n \n Without the git-flow extensions:  \n   \n ```\n git checkout develop  \n git checkout -b release/0.1.0  \n ```\n \n When using the git-flow extensions:  \n   \n ``` git flow release start 0.1.0 ```\n  \n Switched to a new branch 'release/0.1.0\n  \n  ##### Finishing a release branch  \n To finish a release branch, use the following methods:  \n   \n Without the git-flow extensions:  \n   ```\n git checkout master  \n git merge release/0.1.0  \n ```\n When using the git-flow extension::  \n   ```\n git flow release finish '0.1.0'  \n   ```\n   \nOnce the release is ready to ship, it will get merged it into master and develop, then the release branch will be deleted. \nIt’s important to merge back into develop because critical updates may have been added to the release branch and they need to \nbe accessible to new features. If your organization stresses code review, this would be an ideal place for a pull request.  \n    \n Don't forget to push your tags with ```git push origin --tags  ```\n   \n   \n #### Hotfix Branches  \n   \n Maintenance or “hotfix” branches are used to quickly patch production releases. Hotfix branches are a \n lot like release branches and feature branches except they're based on master instead of develop. \n This is the only branch that should fork directly off of master. As soon as the fix is complete, it should be merged into both master and  \n  develop (or the current release branch), and master should be tagged with an updated version number.  \n    \n   ##### Creating a hotfix branch\n  Without the git-flow extensions:  \n  ```\n  git checkout master  \n  git checkout -b hotfix_branch  \n  ```\n  When using the git-flow extensions:   \n    \n  ```\n   git flow hotfix start hotfix_branch  \n   ```\n    \n  ##### Finishing a hotfix branch    \nWithout the git-flow extensions:  \n  ```  \n  git checkout master  \n  git merge hotfix_branch  \n  git checkout develop  \n  git merge hotfix_branch  \n  git branch -D hotfix_branch  \n  ```\n\n When using the git-flow extensions: \n  ``` \n  git flow hotfix finish hotfix_branch  \n  ```\n    \n   \n ### The overall flow of Gitflow is:      \n-   A develop branch is created from master    \n-   Feature branches are created from develop  \n-   When a feature is complete it is merged into the develop branch  \n-   Bugfix branches are created from develop\n-   When bug fixed are done  it is merged into the develop branch \n-   Release branch is created from develop\n-   When the release branch is done it is merged into develop and master  \n-   If an issue in master is detected a hotfix branch is created from master  \n-   When the hotfix is complete it is merged to both develop and master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnahidulhasan%2Fgit-flow-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnahidulhasan%2Fgit-flow-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnahidulhasan%2Fgit-flow-example/lists"}