Public:Working with code repo

From YaddaWiki

Jump to: navigation, search

By default we work in so called 'shared repository model' where master branch is the branch we release from. Each developer has the right to push directly into the master branch (if the corresponding pull merge has been accepted). Every new feature is developed in some feature branch dedicated to this feature.

When you start developing a new functionality (or part of it), you create a new separate branch, you commit chunks of code, and then issue a pull request. After the pull request has been accepted by your colleague, you commit & push the changes as one commit to the master branch. This way the git log of the master branch will have linear history. The commit's name template for a master branch is as follows: CLOSES #ISSUE_NO: ISSUE_TITLE, where: - ISSUE_NO is the github's/gitlab's issue number - ISSUE_TITLE is the github's/gitlab's issue title


  1. Create a feature branch: git checkout -b feature_branch_name (feature_branch_name should start with your github login)

  2. Make your changes

  3. Commit your changes

  4. [Optionally, so the pull request will be more up-to-date] Clean up your history: git rebase master

  5. Run tests: gradlew clean test and gradlew clean slowTest

  6. Push the changes: git push origin feature_branch_name

  7. Issue a pull request on github (or merge request on GitLab) with master as the base branch and feature as the head branch

  8. Wait for changes to be accepted. If you are asked to revise your changes, edit your branch and push the changes.

  9. Clean up your history: git rebase master

  10. Merge the feature branch into master: git checkout master and then git merge feature_branch_name (or git merge --squash feature_branch_name if there are more than 1 commit in the feature branch)

  11. If merge was done with --squash option, then commit merged changes and modify commit message: git commit

  12. Pull the changes from origin: git pull --rebase origin (or git fetch origin and git rebase origin/master)

  13. Run tests before push: gradlew clean test and gradlew clean slowTest

  14. Push the changes to the master branch: git push origin master

  15. Delete the feature branch: git branch -D feature_branch_name and then git push origin :feature_branch_name

  16. [Optionally] Delete references to remote branches that do not exist in the repository anymore: git remote prune origin

Personal tools