Skip to content

Git Flow

We use the develop/master variation of the OneFlow git flow

Add New Features

We use feature (topic) branches to implement new features

You are an internal developer if you have writing permissions to the repository.

Most feature branches are never pushed to the repo, only do so if you expect that its development will take days (to avoid losing your work if you computer is damaged). Otherwise follow the following instructions to locally rebase your feature branch into develop and push those rebased changes online.

Starting your feature branch

  1. Pull the latest develop
    git checkout develop
    git pull
    
  2. Create your feature branch
    git checkout -b feature/feature1
    
  3. Add, modify or delete the necessary files to add your new feature
  4. Update the change log (docs/change-log.md)
  5. Stage and commit your changes using VS Code git GUI or the following commands
    git add modified-file1 modified-file2
    git commit -m "Add my new feature" # use a concise description
    

Merging back your feature branch

If your changes took time to be implemented it is possible that there are new commits in our develop branch, so we need to rebase your feature branch.

  1. Fetch the latest changes to develop

    git fetch origin develop
    

  2. Rebase your feature branch

    git checkout feature/feature1
    git rebase -i develop
    

  3. Integrate your new feature to develop

    git checkout develop
    git merge --no-ff feature/feature1 # (use the default merge message)
    git push origin develop
    git branch -d feature/feature1
    

You are an external developer if you do NOT have writing permissions to the repository.

Starting your feature branch

  1. Fork and clone our repository on Github
  2. Switch to the latest develop
    git checkout develop
    
  3. Create your feature branch
    git checkout -b feature/external-test
    
  4. Add, modify or delete the necessary files to add your new feature
  5. Stage and commit your changes using VS Code git GUI or the following commands
    git add modified-file1 modified-file2
    git commit -m "Add my new feature" # use a concise description
    

Merging back your feature branch

If your changes took time to be implemented, it is possible that there are new commits in our develop branch, so we need to rebase your feature branch.

  1. Add our repo as another remote

    git remote add upstream https://github.com/carissalow/rapids/
    

  2. Fetch the latest changes to develop

    git fetch upstream develop 
    

  3. Rebase your feature branch

    git checkout feature/external-test
    git rebase -i develop
    

  4. Push your feature branch online

    git push --set-upstream origin feature/external-test
    

  5. Open a pull request to the develop branch using Github’s GUI

Release a New Version

  1. Pull the latest develop
    git checkout develop
    git pull
    
  2. Create a new release branch
    git describe --abbrev=0 --tags # Bump the release (0.1.0 to 0.2.0 => NEW_HOTFIX)
    git checkout -b release/v[NEW_RELEASE] develop
    
  3. Add new tag
    git tag v[NEW_RELEASE]
    
  4. Merge and push the release branch
    git checkout develop
    git merge release/v[NEW_RELEASE]
    git push --tags origin develop
    git branch -d release/v[NEW_RELEASE]
    
  5. Fast-forward master
    git checkout master
    git merge --ff-only develop
    git push # Unlock the master branch before merging
    
  6. Release happens automatically after passing the tests

Release a Hotfix

  1. Pull the latest master
    git checkout master
    git pull
    
  2. Start a hotfix branch
    git describe --abbrev=0 --tags # Bump the hotfix (0.1.0 to 0.1.1 => NEW_HOTFIX)
    git checkout -b hotfix/v[NEW_HOTFIX] master
    
  3. Fix whatever needs to be fixed
  4. Update the change log
  5. Tag and merge the hotfix
    git tag v[NEW_HOTFIX]
    git checkout develop
    git merge hotfix/v[NEW_HOTFIX]
    git push --tags origin develop
    git branch -d hotfix/v[NEW_HOTFIX]
    
  6. Fast-forward master
    git checkout master
    git merge --ff-only v[NEW_HOTFIX]
    git push # Unlock the master branch before merging
    
  7. Release happens automatically after passing the tests