Commit 3711620e authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Fix #287, updated CONTRIBUTING.md with the correct merging strategy. (#293)

parent 1ad5425f
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@ Our GitHub-based [workflow](https://discos.readthedocs.io/en/latest/developer/ho

- Check out into master branch
`git checkout master`
- Fetch all remote updates
`git remote update`
- Update local master branch with remote copy
`git pull origin master`
- Check out into stable branch
@@ -47,20 +45,26 @@ Our GitHub-based [workflow](https://discos.readthedocs.io/en/latest/developer/ho
- Push the hotfix branch to remote repository
`git push origin fix-issue-xxx`
- Open a "Pull request" in GitHub, in order to merge the hotfix branch onto the stable branch, and reqeust a review from the team
- Once the team approves the pull request, the branch can be merged using the "Squash and merge" strategy, be sure to not delete the hotfix branch
- Open a second "Pull request" in GitHub, in order to merge the hotfix branch onto the master branch
- Once again, once the team approves the pull request, the branch can be merged using the "Squash and merge" strategy, this time the branch can be deleted
- If some conflict between the master and the hotfix branch arises, don't worry, they can be fixed right away when merging online. Resolve the conflict by porting the new lines from the hotfix branch into the master branch version of the file.
- Finally, delete the hotfix branch from the local repository
- Once the team approves the pull request, the branch can be merged using the "Squash and merge" strategy. Be sure to delete the hotfix branch after it gets merged
- Open a second "Pull request" in GitHub, in order to merge the stable branch with the new hotfix onto the master branch
- Once again, as soon as the team approves the pull request, the branch can be merged, but now you have to select the "Create a merge commit" strategy. You have to insert the following commit message: "Merging latest bugfix onto master."
- If some conflict between the master and the stable branch arises, don't worry, they can be fixed right away when merging online. Resolve the conflict by porting the new lines from the stable branch into the master branch version of the file.
- You can now delete the hotfix branch from the local repository
`git branch -D fix-issue-xxx`
- Check out once again into master branch
`git checkout master`
- Update local master branch with remote copy
`git pull origin master`
- Check out once again into stable branch
`git checkout stable`
- Update local stable branch with remote copy
`git pull origin stable`
- Now that the hotfix is on the online repository, a new tag can be created onto the stable branch. In order to do this, go to the releases page of the repository, and select "Draft a new release". Fill the "Tag version" and "Release title" fields according to the previous releases. Also, be sure to select the stable branch as target and to check "This is a pre-release" if you are not sure if your release is ready to be deployed on production line.

### Feature implementation workflow

- Check out into master branch
`git checkout master`
- Fetch all remote updates
`git remote update`
- Update local master branch with remote copy
`git pull origin master`
- Create a branch related to the issue xxx
@@ -71,6 +75,9 @@ Our GitHub-based [workflow](https://discos.readthedocs.io/en/latest/developer/ho
`git push origin fix-issue-xxx`
- Open a "Pull request" in GitHub for team to verify the feature
- Once the team approves the pull request, the branch can be merged using the "Squash and merge" strategy, and it can be deleted from the online repository
- Finally, delete the feature branch from the local repository
- You can now delete the feature branch from the local repository
`git branch -D fix-issue-xxx`
- Check out once again into master branch
`git checkout master`
- Update local master branch with remote copy
`git pull origin master`