Skip to content

Instantly share code, notes, and snippets.

@twoism-dev
Last active December 17, 2024 21:27
Show Gist options
  • Save twoism-dev/9929426 to your computer and use it in GitHub Desktop.
Save twoism-dev/9929426 to your computer and use it in GitHub Desktop.

Revisions

  1. twoism-dev revised this gist Apr 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ We have two branches **develop** and **master**.
    * Use **--no-ff** when merging your feature branch into develop or master, this forces creation of a merge commit, making it easier to see what was merged and when.

    ## Working on a new feature ##
    * Create a new branch **from master** called 'feature/<trello-card-number>-<descriptive-name>'
    * Create a new branch **from master** called 'feature/[trello-card-id]'
    ```
    $ git checkout -b feature/160-add-picture-of-cat master
    ```
  2. twoism-dev renamed this gist Apr 2, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. twoism-dev created this gist Apr 2, 2014.
    53 changes: 53 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    # Our Git Flow

    We are using a simple git flow based on git flow and github flow.
    We have two branches **develop** and **master**.

    **develop** is a representation of staging

    **master** is a representation of production

    ## The Rules ##
    * Master is **always** deployable.
    * All tests must pass on Master at all times.
    * **Do not** commit directly to develop or master, only merge in feature/fix branches.
    * As soon as a feature/fix is merged into develop it should be deployed to staging.
    * As soon as a feature/fix is merged into master it should be deployed to production.
    * Feature branches should be pushed to origin, for code review and so others can see what is being worked on.
    * Use **--no-ff** when merging your feature branch into develop or master, this forces creation of a merge commit, making it easier to see what was merged and when.

    ## Working on a new feature ##
    * Create a new branch **from master** called 'feature/<trello-card-number>-<descriptive-name>'
    ```
    $ git checkout -b feature/160-add-picture-of-cat master
    ```
    * Work on feature
    * Push feature to origin regularly
    ```
    $ git push -u origin feature/160-add-picture-of-cat
    ```
    * Submit for code review (if required) (e.g. move trello card to code review)
    * Merge feature into develop
    ```
    $ git checkout develop
    Switched to branch 'develop'
    $ git merge --no-ff feature/160-add-picture-of-cat
    $ git push origin
    ```
    * Deploy to staging
    ```
    $ git push staging develop:master
    ```
    * Submit for QA (e.g. move trello card to QA)
    * Merge feature into master
    ```
    $ git checkout master
    Switched to branch 'master'
    $ git merge --no-ff feature/160-add-picture-of-cat
    $ git push origin
    ```
    * Deploy master to production
    ```
    $ git push production master
    ```
    * Delete feature branch