Sauter Git Workflow : Working on a new feature - sauter-hq/git-guidelines GitHub Wiki

SourceTree

  • If not already on the branch develop, check it out (i.e. Checkout).

    Checkout the Develop Branch

  • Pull the new state to be up-to-date (let everything by default).

    Pull the new state to be up-to-date

  • Click on Git Flow and select the Start New Feature button

    Click on start new Feature

  • Enter Feature Name branch (i.e. Separate words with the character "-"), this could be for example new-files-format

    Enter the new feature name
    Let the default Start at: Latest development branch, this should begin on the top of the develop branch.

  • Push your changes you've made in the feature branch.
    Its a good idea to select the branch in the navigation bar and push it using the context menu. In that case you will get the right defaults (only the branch you are working on is selected)

    Push Feature Branch
    Note: If you use the Push button from the toolbar, the wrong branches are selected by default. In that case you need to change them.

    Push changes

  • After this operation you can see a new branch (your freshly created branch) on github.

    Feature Branch On The Server

Command Line

  • If not already on the branch develop, check it out (i.e. Checkout).

    git checkout develop
    
    Switched to branch 'develop'
    Your branch is up-to-date with 'origin/develop'.
    
  • Pull the new state to be up-to-date (let everything by default).

    git pull origin
    
    Already up-to-date.
    
  • Now start a new feature named additional-feature with git flow :

    git flow feature start additional-feature
    
    Switched to a new branch 'feature/additional-feature'
    
    Summary of actions:
    - A new branch 'feature/additional-feature' was created, based on 'develop'
    - You are now on branch 'feature/additional-feature'
    
    Now, start committing on your feature. When done, use:
    git flow feature finish additional-feature
    
  • Make some changes, commit them and push them :

    git push origin feature/additional-feature
    
    Counting objects: 3, done.
    Delta compression using up to 2 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 281 bytes | 0 bytes/s, done.
    Total 3 (delta 1), reused 0 (delta 0)
    To github.ch.sauter-bc.com:SBA-Test/test-application.git
       f2e7a18..36ec0b7  feature/additional-feature -> feature/additional-feature
    
  • After this operation you can see a new branch (your freshly created branch) on github.

    Feature Branch On The Server