{"id":16900050,"url":"https://github.com/danielbankhead/git-branching-model","last_synced_at":"2025-07-19T23:09:42.557Z","repository":{"id":143868229,"uuid":"97402639","full_name":"danielbankhead/git-branching-model","owner":"danielbankhead","description":"A welcoming git branching model.","archived":false,"fork":false,"pushed_at":"2017-11-18T23:47:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-20T12:32:36.465Z","etag":null,"topics":["branching-strategies","git","git-branch","git-workflow"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielbankhead.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2017-07-16T18:27:43.000Z","updated_at":"2019-04-21T00:56:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e152ba53-0142-4c18-a036-77c8a230fdb5","html_url":"https://github.com/danielbankhead/git-branching-model","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/danielbankhead/git-branching-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbankhead%2Fgit-branching-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbankhead%2Fgit-branching-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbankhead%2Fgit-branching-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbankhead%2Fgit-branching-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielbankhead","download_url":"https://codeload.github.com/danielbankhead/git-branching-model/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbankhead%2Fgit-branching-model/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266039001,"owners_count":23867815,"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":["branching-strategies","git","git-branch","git-workflow"],"created_at":"2024-10-13T17:51:24.758Z","updated_at":"2025-07-19T23:09:42.519Z","avatar_url":"https://github.com/danielbankhead.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Branching Model\n\nWe have 5 types of branches: [**Master**](#master), [**Staging**](#staging), [**Feature**](#feature), [**Hotfix**](#hotfix), and [**LTS**](#lts).\n\nContributors are welcome to make pull requests to [**Staging**](#staging), [**Feature**](#feature), [**Hotfix**](#hotfix), and [**LTS**](#lts). Contributors are welcome to make pull requests to create new [**Feature**](#feature), [**Hotfix**](#hotfix), and [**LTS**](#lts) branches. No code is required to create a pull request for a new [**Feature**](#feature) branch if it is a mere proposal.\n\nMaintainers manage the merging between branches and any releases that follow.\n\n\n## Definitions \u0026 Terminology\n\n### Stable\n\nThe term \"**stable**\" is used when all tests pass and the branch is deemed reliable in the context of the project. This does not include the project's dependencies, including platform.\n\n### LTS.md\n\n\"**LTS.md**\" is a file in the root of a repository with a list of long-term support in a format that can be easily human \u0026 machine parsed, if the project has an LTS release. The project's **README.md** should link to this file, if it exists, for the convenience of visitors. The file should be in markdown table format with `LTS`, `Started`, `Expires`, and `Notes` columns. The `LTS` column should match the lts branch's name, minus the 'lts-' prefix and the `Started` and `Expires` columns should be in YYYY-MM-DD format. The dates coorespond with 00:00 (midnight) in UTC to avoid time/timezone ambiguity. Example:\n\n| LTS           | Started       | Expires    | Notes                                                      |\n| ------------- | ------------- | ---------- | ---------------------------------------------------------- |\n| 1.x           | 2017-08-01    | 2019-08-01 | The first LTS release (the `lts-1.x` branch)               |\n| 2.x           | 2018-01-31    | 2020-01-31 | The second LTS release. This is an example for a [link](#) |\n\n\n## Branches\n\n### Master\n\nName: `master`\n\nThe public, default, go-to branch that we know and love. Git tags are generated whenever new commits are merged to this branch. This branch will be tagged in accordance to [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html), even if it means rapid-release of major versions.\n\n### Staging\n\nName: `staging`\n\nThe branch where future features and releases are prepared for master. While this branch is under constant development, it aims to be *stable* at all times (thus encourages quality commits and contributions). This branch must be *stable* before being merged onto master.\n\nThis branch must also contain an up-to-date **LTS.md** file as well, if any LTS releases are available.\n\n### Feature\n\nName: `feature-NAME`, where `NAME` is an alias or title of the feature.\n\nA branch for new features, especially those that require long-term development, discussion, and/or wait on a particular dependency/event (such as a platform update). New feature branches should be created by branching from [**Staging**](#staging).\n\nOnce the new feature is ready to be implemented, the current [**Staging**](#staging) branch should be re-merged onto the branch to handle any conflicts on the feature branch rather than the [**Staging**](#staging) branch. Once successfully merged to [**Staging**](#staging) the branch should not be updated anymore and is kept **only for archival purposes**.\n\n### Hotfix\n\nName: `hotfix-NAME` where `NAME` is an alias or title of the fix.\n\nA branch for any emergencies fixes, usually for security purposes. Once *stable*, this branch is merged directly onto [**Master**](#master), [**Staging**](#staging), and any active [**LTS**](#lts) (where fix is applicable) then **deleted**. Once merged onto [**Master**](#master) a new tag must be created.\n\n### LTS\n\nName: `lts-MAJOR_VERSION.x`, where `MAJOR_VERSION` is the major version of the lts\n\nAn optional branch for any LTS releases created from [**Master**](#master). LTS releases can be useful if the project requires long-term reliability of APIs for dependents. The information for an LTS.md branch can be found in **LTS.md** at the root of the repository.\n\nLTS branches may have unique configuration and scripts to simplify builds and releases. An example for an npm package:\n  ```json\n  \"publishConfig\": {\n    \"tag\": \"1.x\"\n  },\n  \"scripts\": {\n    \"prepublishOnly\": \"node tools/special-build-for-lts-1.x.js\"\n  }\n  ```\n  - In this example:\n    - `publishConfig.tag` allows you to run `npm publish` without worrying about accidentally overwriting the default distribution tag ('latest') upon publishing. Run `npm info npm dist-tags` to see a real-world example for how this can be useful.\n    - `scripts.prepublishOnly` useful for unique builds for an LTS branch - triggers on `npm publish`\n\nOnce support has been dropped, the branch should not be updated anymore and is kept **only for archival purposes**.\n\n\n## Goals\n  - make contributing and maintaining projects as simple as possible, especially for those new to `git`.\n  - should be 'welcoming' to innovation so that people can feel comfortable (at any experience level) to make a contribution of any size.\n\n\n## Notes\nMaintainers may find `git branch --set-upstream-to` handy. See the following example:\n```sh\n# Set local staging to track origin's staging\ngit checkout staging\ngit branch --set-upstream-to origin/staging\n\n# Set local master to track origin's master\ngit checkout master\ngit branch --set-upstream-to origin/master\n\n# check which local branch is watching which origin branch\ngit branch -vv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbankhead%2Fgit-branching-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielbankhead%2Fgit-branching-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbankhead%2Fgit-branching-model/lists"}