{"id":19725376,"url":"https://github.com/bodacious/gitstrategy","last_synced_at":"2026-02-04T15:02:13.128Z","repository":{"id":2383059,"uuid":"3348582","full_name":"Bodacious/GitStrategy","owner":"Bodacious","description":"Katana Code's Git Strategy","archived":false,"fork":false,"pushed_at":"2014-05-29T13:05:53.000Z","size":119,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T21:44:49.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/Bodacious.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}},"created_at":"2012-02-03T21:40:55.000Z","updated_at":"2021-09-22T11:03:29.000Z","dependencies_parsed_at":"2022-09-09T02:22:50.514Z","dependency_job_id":null,"html_url":"https://github.com/Bodacious/GitStrategy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bodacious/GitStrategy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2FGitStrategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2FGitStrategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2FGitStrategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2FGitStrategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bodacious","download_url":"https://codeload.github.com/Bodacious/GitStrategy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bodacious%2FGitStrategy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29088409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T23:29:31.909Z","updated_at":"2026-02-04T15:02:13.110Z","avatar_url":"https://github.com/Bodacious.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Katana Code's Git Strategy\n\n## Introduction\n\nThe purpose of this document is to define the strategy which all Katana Code employees and subcontractors must adhere to when working on Katana Code projects. \n\nThe aim is to develop a uniform, coherent and effective solution. This document is not written in stone and can be updated as and when better approaches are discovered.\n\n## Topic Branches\n\nEach project must have a \"primary\" branch (usually **master**).\n\nOn website applications a **staging** and **production** branch may also be used to point to staging and production releases respectively. In this case, the **production** branch will be the \"primary\" branch.\n\n### Creating Topic Branches\n\nWhen making changes to the code, one must typically check out a *new* topic branch from the primary branch.\n\n``` bash\n$ git co -b feature/feature_name\n```\n\nWhen checking out an existing topic branch (continuing development of an existing feature) one must first rebase this branch on the primary branch.\n\n``` bash\n$ git co feature/existing\n$ git rebase production\n```\n\n### Naming Topic Branches\n\nTopic branches must be nested under one of the following categories:\n\n* feature - A feature of the application is being developed. \u003cbr\u003ee.g. **feature/comments**\n* bug - A single bug is being corrected.\u003cbr\u003ee.g. **bug/sign_in**\n* refactor - A single file of the code is being refactored.\u003cbr\u003ee.g. **refactor/user.rb**\n* dev - The code is being modified to improve development.\u003cbr\u003ee.g. **dev/upgrading_rails**. This includes:\n    * Upgrading software versions\n    * Replacing gems/libraries\n    * Adding development tools such as macros for testing.\n* copy - Some of the page copy in the application templates is being changed. \u003cbr\u003e e.g. **copy/about_us**\n* config - A configuration has changed.\u003cbr\u003e e.g. **config/amazon_settings**\n* design - Artwork, HTML or CSS is being changed to incorporate a new design. No behavioural changes may be made.\u003cbr\u003e e.g. **design/sign_up_button**\n* documentation - This should not be a nested branch. All documentation may be committed under a main **documentation** branch. When stamping files with [katana_stamp](https://github.com/KatanaCode/katana_stamp) \u003cbr\u003e NOTE - Documentation files should not be stored within the Git repository (see Ignore Files).\n\nTopic branches may be sub-nested if doing so helps to explain the nature of the topic in more depth. e.g., **feature/api/session_management**\n\n### Merging Topic Branches\n\nWhen a topic branch is ready to be committed to the primary branch, one must first rebase the topic branch on the primary branch.\n\n    $ git rebase master # while on topic\n    \nOnce HEAD has successfully been merged with the primary branch, checkout the primary branch and merge the topic branch in without fast-forward.\n\n    $ git co master\n    $ git merge --no-ff topic\n    \n### Remote Topic Branches\n\nIf a topic branch is ready to be merged into a primary branch, one must also push an upstream branch with the same name to the central, remote repository.\n\n    $ git push -u origin topic\n    \nThis ensures another team member can pick up the commit and merge it into other branches or modify it if required.\n\n### Managing Environment Branches\n\nFor web apps with staging, and production environments, all topic branches must be rebased off, and merged into **staging**.\n\nWith the exception of hotfix branches, the *only* branch that may be merged into production is the staging branch.\n\n    # Merging a topic into staging and then production\n    $ git co staging\n    $ git merge --no-ff topic\n    $ git co production\n    $ git merge --no-ff staging\n\n### Hotfix branches\n\nOccasionally there's a bug that must be fixed **urgently**. In these cases, one may create a branch off production with the prefix *hotfix*, make the required fixes there, and then merge that into production for fast deployment.\n\n    # Creating a hotfix branch\n    # ...From the production branch\n    $ git co hotfix/signupBug\n    # Make the changes and commit.\n    $ git co production\n    $ git merge hotfix/signupBug\n    \n    # Once the problem has been resolved, clean up by merging this into staging.\n    $ git rebase staging hotfix/signupBug\n    $ git co staging\n    $ git merge --no-ff hotfix/signupBug\n    \n\n## Ignore Files\n\nEach repository must have a `.gitignore` file. The following files/directories must be ignored where applicable.\n\n### For All Projects\n\n    .bundle\n    Gemfile.lock\n    .rvmrc\n    doc/\n\n### For Web Apps\n\n    *.log\n    *.sql.gz\n    *.sql\n    .sass-cache/\n    .DS_Store\n    tmp/\n    public/index.html\n    public/assets\n\n### For Gems\n\n    pkg/ \n    .gem\n\n## Versioning\n\nNew version releases should always be committed on the primary branch.\n\nAll version releases must also be tagged. When working on a gem, `$ rake release` will do this for you. When working on a web application, use [per-version](https://github.com/bodacious/per-version)\n\nTo tag a commit manually, use:\n\n    $ git tag v1.2.3 -m \"Version 1.2.3\"\n\nKatana Code observes [semantic versioning](http://semver.org/) unless otherwise stated.\n\n## Some Git tips\n\n### Amending Commits\n\nWhen stubby fingers stumble, typos happen! To correct a commit message, use:\n\n$ git commit --amend\n\n### Resetting HEAD\n\nIf you want to roll back to a previous commit, you can do a \"hard reset\":\n\n    $ git reset --hard 5a4a26fd4490b2c5cbd4e64afb3a9790c4924de3\n    \n## About Katana Code\n\nKatana Code are [iPhone app and Ruby on Rails Developers in Edinburgh, Scotland](http://katanacode.com/ \"Katana Code\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodacious%2Fgitstrategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodacious%2Fgitstrategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodacious%2Fgitstrategy/lists"}