Skip to content

Instantly share code, notes, and snippets.

@eimajtrebor
Forked from JamesMGreene/gitflow-breakdown.md
Created May 30, 2018 10:20
Show Gist options
  • Save eimajtrebor/ce7ad6dd910030b5d7eb957ed96cf74e to your computer and use it in GitHub Desktop.
Save eimajtrebor/ce7ad6dd910030b5d7eb957ed96cf74e to your computer and use it in GitHub Desktop.

Revisions

  1. @JamesMGreene JamesMGreene revised this gist Nov 30, 2017. 1 changed file with 25 additions and 25 deletions.
    50 changes: 25 additions & 25 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    gitflow | git
    --------|-----
    `git flow init` | `git init`
    | `git commit --allow-empty -m "Initial commit"`
    | `git checkout -b develop master`
      | `git commit --allow-empty -m "Initial commit"`
      | `git checkout -b develop master`


    ## Connect to the remote repository
    @@ -28,32 +28,32 @@ gitflow | git
    gitflow | git
    --------|-----
    `git flow feature publish MYFEATURE` | `git checkout feature/MYFEATURE`
    | `git push origin feature/MYFEATURE`
      | `git push origin feature/MYFEATURE`


    ### Get latest for a feature branch

    gitflow | git
    --------|-----
    `git flow feature pull origin MYFEATURE` | `git checkout feature/MYFEATURE`
    | `git pull --rebase origin feature/MYFEATURE`
      | `git pull --rebase origin feature/MYFEATURE`


    ### Finalize a feature branch

    gitflow | git
    --------|-----
    `git flow feature finish MYFEATURE` | `git checkout develop`
    | `git merge --no-ff feature/MYFEATURE`
    | `git branch -d feature/MYFEATURE`
      | `git merge --no-ff feature/MYFEATURE`
      | `git branch -d feature/MYFEATURE`


    ### Push the merged feature branch

    gitflow | git
    --------|-----
    _N/A_ | `git push origin develop`
    | `git push origin :feature/MYFEATURE` _(if pushed)_
      | `git push origin :feature/MYFEATURE` _(if pushed)_


    ## Releases
    @@ -70,37 +70,37 @@ gitflow | git
    gitflow | git
    --------|-----
    `git flow release publish 1.2.0` | `git checkout release/1.2.0`
    | `git push origin release/1.2.0`
      | `git push origin release/1.2.0`


    ### Get latest for a release branch

    gitflow | git
    --------|-----
    _N/A_ | `git checkout release/1.2.0`
    | `git pull --rebase origin release/1.2.0`
      | `git pull --rebase origin release/1.2.0`


    ### Finalize a release branch

    gitflow | git
    --------|-----
    `git flow release finish 1.2.0` | `git checkout master`
    | `git merge --no-ff release/1.2.0`
    | `git tag -a 1.2.0`
    | `git checkout develop`
    | `git merge --no-ff release/1.2.0`
    | `git branch -d release/1.2.0`
      | `git merge --no-ff release/1.2.0`
      | `git tag -a 1.2.0`
      | `git checkout develop`
      | `git merge --no-ff release/1.2.0`
      | `git branch -d release/1.2.0`


    ### Push the merged feature branch

    gitflow | git
    --------|-----
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :release/1.2.0` _(if pushed)_
      | `git push origin develop`
      | `git push origin --tags`
      | `git push origin :release/1.2.0` _(if pushed)_


    ## Hotfixes
    @@ -117,21 +117,21 @@ gitflow | git
    gitflow | git
    --------|-----
    `git flow hotfix finish 1.2.1` | `git checkout master`
    | `git merge --no-ff hotfix/1.2.1`
    | `git tag -a 1.2.1`
    | `git checkout develop`
    | `git merge --no-ff hotfix/1.2.1`
    | `git branch -d hotfix/1.2.1`
      | `git merge --no-ff hotfix/1.2.1`
      | `git tag -a 1.2.1`
      | `git checkout develop`
      | `git merge --no-ff hotfix/1.2.1`
      | `git branch -d hotfix/1.2.1`


    ### Push the merged hotfix branch

    gitflow | git
    --------|-----
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :hotfix/1.2.1` _(if pushed)_
      | `git push origin develop`
      | `git push origin --tags`
      | `git push origin :hotfix/1.2.1` _(if pushed)_



  2. @JamesMGreene JamesMGreene revised this gist Jul 1, 2014. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -133,3 +133,10 @@ _N/A_ | `git push origin master`
    | `git push origin --tags`
    | `git push origin :hotfix/1.2.1` _(if pushed)_



    ## References

    - http://nvie.com/posts/a-successful-git-branching-model/
    - https://help.github.com/articles/using-pull-requests#shared-repository-model
    - Personal experience
  3. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -81,7 +81,7 @@ _N/A_ | `git checkout release/1.2.0`
    | `git pull --rebase origin release/1.2.0`


    # Finalize a release branch
    ### Finalize a release branch

    gitflow | git
    --------|-----
  4. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -48,7 +48,7 @@ gitflow | git
    | `git branch -d feature/MYFEATURE`


    ### Push the finalized feature branch
    ### Push the merged feature branch

    gitflow | git
    --------|-----
    @@ -93,7 +93,7 @@ gitflow | git
    | `git branch -d release/1.2.0`


    ### Push the finalized feature branch
    ### Push the merged feature branch

    gitflow | git
    --------|-----
    @@ -124,7 +124,7 @@ gitflow | git
    | `git branch -d hotfix/1.2.1`


    ### Push a hotfix branch
    ### Push the merged hotfix branch

    gitflow | git
    --------|-----
  5. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ gitflow | git
    gitflow | git
    --------|-----
    _N/A_ | `git push origin develop`
    | `git push origin :feature/MYFEATURE # If pushed`
    | `git push origin :feature/MYFEATURE` _(if pushed)_


    ## Releases
    @@ -100,7 +100,7 @@ gitflow | git
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :release/1.2.0 # If pushed`
    | `git push origin :release/1.2.0` _(if pushed)_


    ## Hotfixes
    @@ -131,5 +131,5 @@ gitflow | git
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :hotfix/1.2.1 # If pushed`
    | `git push origin :hotfix/1.2.1` _(if pushed)_

  6. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 26 additions and 15 deletions.
    41 changes: 26 additions & 15 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ gitflow | git
    gitflow | git
    --------|-----
    _N/A_ | `git push origin develop`
    | `git push origin :feature/MYFEATURE`
    | `git push origin :feature/MYFEATURE # If pushed`


    ## Releases
    @@ -100,25 +100,36 @@ gitflow | git
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :release/1.2.0`
    | `git push origin :release/1.2.0 # If pushed`


    ```sh
    git flow hotfix start 1.2.1 [master|develop]
    ## Hotfixes

    ### Create a hotfix branch

    git checkout -b hotfix-1.2.1 [master|develop]
    ```
    gitflow | git
    --------|-----
    `git flow hotfix start 1.2.1 [commit]` | `git checkout -b hotfix/1.2.1 [commit]`


    ### Finalize a hotfix branch

    gitflow | git
    --------|-----
    `git flow hotfix finish 1.2.1` | `git checkout master`
    | `git merge --no-ff hotfix/1.2.1`
    | `git tag -a 1.2.1`
    | `git checkout develop`
    | `git merge --no-ff hotfix/1.2.1`
    | `git branch -d hotfix/1.2.1`

    ```sh
    git flow hotfix finish 1.2.1

    ### Push a hotfix branch

    gitflow | git
    --------|-----
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :hotfix/1.2.1 # If pushed`

    git checkout develop
    git merge --no-ff hotfix-1.2.1
    git checkout master
    git merge --no-ff hotfix-1.2.1
    git branch -d hotfix-1.2.1
    git tag -a 1.2.1
    ```
  7. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ gitflow | git

    gitflow | git
    --------|-----
    `git remote add origin [email protected]:MYACCOUNT/MYREPO` | _same_
    _N/A_ | `git remote add origin [email protected]:MYACCOUNT/MYREPO`


    ## Features
  8. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 63 additions and 49 deletions.
    112 changes: 63 additions & 49 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -1,92 +1,106 @@
    ### Initialize
    ## Initialize

    gitflow | git
    --------|----
    --------|-----
    `git flow init` | `git init`
    | `git commit --allow-empty -m "Initial commit"`
    | `git checkout -b develop`
    | `git checkout -b develop master`


    ### Connect to the remote repository
    ## Connect to the remote repository

    gitflow | git
    --------|-----
    `git remote add origin [email protected]:MYACCOUNT/MYREPO` | `git remote add origin [email protected]:MYACCOUNT/MYREPO`

    `git remote add origin [email protected]:MYACCOUNT/MYREPO` | _same_

    ### Create a feature branch

    ## Features

    ```sh
    git flow feature start MYFEATURE
    ```
    ### Create a feature branch

    git checkout -b MYFEATURE develop # Create a `MYFEATURE` branch from `develop` and the check it out
    ```
    gitflow | git
    --------|-----
    `git flow feature start MYFEATURE` | `git checkout -b feature/MYFEATURE develop`


    ```sh
    git flow feature publish MYFEATURE
    ### Share a feature branch

    gitflow | git
    --------|-----
    `git flow feature publish MYFEATURE` | `git checkout feature/MYFEATURE`
    | `git push origin feature/MYFEATURE`

    git push origin MYFEATURE
    ```

    ### Get latest for a feature branch

    ```sh
    git flow feature pull origin MYFEATURE
    gitflow | git
    --------|-----
    `git flow feature pull origin MYFEATURE` | `git checkout feature/MYFEATURE`
    | `git pull --rebase origin feature/MYFEATURE`


    git pull origin MYFEATURE # ????
    ```
    ### Finalize a feature branch

    gitflow | git
    --------|-----
    `git flow feature finish MYFEATURE` | `git checkout develop`
    | `git merge --no-ff feature/MYFEATURE`
    | `git branch -d feature/MYFEATURE`

    ```sh
    git flow feature finish MYFEATURE

    ### Push the finalized feature branch

    git checkout develop # Checkout the `develop` branch
    git merge --no-ff MYFEATURE # Merge the `MYFEATURE` branch into `develop`. `--no-ff` creates a merge commit.
    git branch -d MYFEATURE # Delete the `MYFEATURE` branch
    git push origin develop # Push the `develop` branch to remote
    ```
    gitflow | git
    --------|-----
    _N/A_ | `git push origin develop`
    | `git push origin :feature/MYFEATURE`


    ```sh
    git flow release start 1.2.0
    ## Releases

    ### Create a release branch

    git checkout -b release-1.2.0 develop
    # (Run some commands to update the version)
    git commit -a -m "Bumped version number to 1.2.0"
    ```
    gitflow | git
    --------|-----
    `git flow release start 1.2.0` | `git checkout -b release/1.2.0 develop`


    ```sh
    git flow release publish 1.2.0
    ### Share a release branch

    gitflow | git
    --------|-----
    `git flow release publish 1.2.0` | `git checkout release/1.2.0`
    | `git push origin release/1.2.0`

    git push origin release-1.2.0
    ```

    ### Get latest for a release branch

    ```sh
    git flow release finish 1.2.0
    gitflow | git
    --------|-----
    _N/A_ | `git checkout release/1.2.0`
    | `git pull --rebase origin release/1.2.0`


    git checkout master
    git merge --no-ff release-1.2.0
    git branch -d release-1.2.0
    git tag -a 1.2.0
    ```
    # Finalize a release branch

    gitflow | git
    --------|-----
    `git flow release finish 1.2.0` | `git checkout master`
    | `git merge --no-ff release/1.2.0`
    | `git tag -a 1.2.0`
    | `git checkout develop`
    | `git merge --no-ff release/1.2.0`
    | `git branch -d release/1.2.0`

    ```sh
    git push --tags

    ### Push the finalized feature branch

    git push origin master --tags
    ```
    gitflow | git
    --------|-----
    _N/A_ | `git push origin master`
    | `git push origin develop`
    | `git push origin --tags`
    | `git push origin :release/1.2.0`


    ```sh
    @@ -107,4 +121,4 @@ git checkout master
    git merge --no-ff hotfix-1.2.1
    git branch -d hotfix-1.2.1
    git tag -a 1.2.1
    ```
    ```
  9. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 3 additions and 23 deletions.
    26 changes: 3 additions & 23 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -6,32 +6,12 @@ gitflow | git
    | `git commit --allow-empty -m "Initial commit"`
    | `git checkout -b develop`

    With `gitflow`:
    ```sh
    git flow init
    ```

    With raw `git`:
    ```
    # Make this directory into a git repo
    git init
    # Now in `master` branch
    # Make an initial commit for the sake of commit tracking (history, branching, etc.)
    git commit --allow-empty -m "Initial commit"
    # Create a `develop` branch from `master` and then check it out
    git checkout -b develop
    ```


    ### Connect to the remote repository

    With `gitflow` and/or raw `git`:
    ```sh
    # Add the remote repo URL
    git remote add origin [email protected]:MYACCOUNT/MYREPO
    ```
    gitflow | git
    --------|-----
    `git remote add origin [email protected]:MYACCOUNT/MYREPO` | `git remote add origin [email protected]:MYACCOUNT/MYREPO`


    ### Create a feature branch
  10. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ gitflow | git
    --------|----
    `git flow init` | `git init`
    | `git commit --allow-empty -m "Initial commit"`
    | git checkout -b develop
    | `git checkout -b develop`

    With `gitflow`:
    ```sh
  11. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,9 @@

    gitflow | git
    --------|----
    ```sh
    git flow init
    ``` | ```sh
    git init
    ```
    `git flow init` | `git init`
    | `git commit --allow-empty -m "Initial commit"`
    | git checkout -b develop

    With `gitflow`:
    ```sh
  12. @JamesMGreene JamesMGreene revised this gist Jun 12, 2014. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,4 @@
    # gitflow.md


    # Initialize
    ### Initialize

    gitflow | git
    --------|----
    @@ -30,7 +27,7 @@ git checkout -b develop
    ```


    # Connect to the remote repository
    ### Connect to the remote repository

    With `gitflow` and/or raw `git`:
    ```sh
    @@ -39,7 +36,7 @@ git remote add origin [email protected]:MYACCOUNT/MYREPO
    ```


    # Create a feature branch
    ### Create a feature branch


    ```sh
  13. @JamesMGreene JamesMGreene created this gist Jun 12, 2014.
    135 changes: 135 additions & 0 deletions gitflow-breakdown.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,135 @@
    # gitflow.md


    # Initialize

    gitflow | git
    --------|----
    ```sh
    git flow init
    ``` | ```sh
    git init
    ```

    With `gitflow`:
    ```sh
    git flow init
    ```

    With raw `git`:
    ```
    # Make this directory into a git repo
    git init
    # Now in `master` branch
    # Make an initial commit for the sake of commit tracking (history, branching, etc.)
    git commit --allow-empty -m "Initial commit"
    # Create a `develop` branch from `master` and then check it out
    git checkout -b develop
    ```


    # Connect to the remote repository

    With `gitflow` and/or raw `git`:
    ```sh
    # Add the remote repo URL
    git remote add origin [email protected]:MYACCOUNT/MYREPO
    ```


    # Create a feature branch


    ```sh
    git flow feature start MYFEATURE
    ```

    git checkout -b MYFEATURE develop # Create a `MYFEATURE` branch from `develop` and the check it out
    ```
    ```sh
    git flow feature publish MYFEATURE
    git push origin MYFEATURE
    ```


    ```sh
    git flow feature pull origin MYFEATURE


    git pull origin MYFEATURE # ????
    ```


    ```sh
    git flow feature finish MYFEATURE


    git checkout develop # Checkout the `develop` branch
    git merge --no-ff MYFEATURE # Merge the `MYFEATURE` branch into `develop`. `--no-ff` creates a merge commit.
    git branch -d MYFEATURE # Delete the `MYFEATURE` branch
    git push origin develop # Push the `develop` branch to remote
    ```


    ```sh
    git flow release start 1.2.0


    git checkout -b release-1.2.0 develop
    # (Run some commands to update the version)
    git commit -a -m "Bumped version number to 1.2.0"
    ```


    ```sh
    git flow release publish 1.2.0


    git push origin release-1.2.0
    ```


    ```sh
    git flow release finish 1.2.0


    git checkout master
    git merge --no-ff release-1.2.0
    git branch -d release-1.2.0
    git tag -a 1.2.0
    ```


    ```sh
    git push --tags


    git push origin master --tags
    ```


    ```sh
    git flow hotfix start 1.2.1 [master|develop]


    git checkout -b hotfix-1.2.1 [master|develop]
    ```


    ```sh
    git flow hotfix finish 1.2.1


    git checkout develop
    git merge --no-ff hotfix-1.2.1
    git checkout master
    git merge --no-ff hotfix-1.2.1
    git branch -d hotfix-1.2.1
    git tag -a 1.2.1
    ```