Pull requests should be created with a the pull request template. Pull requests should also include a short description in the title.
The associated branch can have one or more commits until it has at least one thumbs up, until we have more contributors.
<Short Description>
<BLANK LINE>
<Insert Pull Request Template>
After one or more core team members have given it a Thumbs Up:
- Rebase the branch locally into a single commit following the commit message format.
- Force Push the local, rebased branch back to Git.
- If the Merge Request still displays the old commits, then close and re-open the request.
- Find out how many new commits there are on the branch
- Run the command
git rebase -i HEAD~<Number of new commits on your branch>
- Replace pick with squash on the lines until you have between 8 to 10 commits, you can also replace pick with reword to change the commit message
- Save and close the editor window
- Change the squashed commits' messages if needed, following the commit message format
- Fetch the latest changes by going to VCS->Git->Fetch
- Check out the latest version of master to your local branches.
- Go to VCS->Git->Rebase.
- Select the branch you want to rebase in the
Branch:
dropdown. - Select Interactive option.
- Select your local master branch in the
Onto:
dropdown and continue. - For the
Action
dropdowns, selectsquash
for all commits except the first 8 to 10 and continue. - Resolve any merge conflicts that come up by using the
Merge...
button. - Follow the commit message format when prompted for a commit message.
Each commit message consists of a header and a body. The header has a special format that includes a type and a subject:
<type>: <subject>
<BLANK LINE>
<body>
The header is mandatory.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on Git as well as in various git tools.
Must be one of the following:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests
The subject contains succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end
Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
If the commit reverts a previous commit, it should begin with revert:
, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>.
, where the hash is the SHA of the commit being reverted.
fix: syntax error on function