You can share your git commit conventions in the team via e.g.:
add this into your "~/.gitconfig"-file
[commit] template = ~/.gitmessage
example: github.com/voku/dotfiles/blob/mast...
We store a file in the root of each project: .gitmessage
Then in the project's Contributing section in the Readme, we have:
Before contributing to this project, configure the commit template while in the project root:
git config commit.template .gitmessage
The contents of the gitmessage is: jira/issue-####: Title of issue Description of changes.
We then squash all commits on merge and enforce rebasing.
This makes for a very clean commit log like:
jira/issue-2: Do that These are more changes.
jira/issue-1: Do this These are the changes.
How do you enforce rebasing?
It's a setting in GitLab per project.
Settings > General > Merge Requests. Under Merge method, select "Fast-forward merge".
Description is: "No merge commits are created. Fast-forward merges only. When conflicts arise the user is given the option to rebase."
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can share your git commit conventions in the team via e.g.:
add this into your "~/.gitconfig"-file
example: github.com/voku/dotfiles/blob/mast...
We store a file in the root of each project: .gitmessage
Then in the project's Contributing section in the Readme, we have:
Before contributing to this project, configure the commit template while in the project root:
git config commit.template .gitmessage
The contents of the gitmessage is:
jira/issue-####: Title of issue
Description of changes.
We then squash all commits on merge and enforce rebasing.
This makes for a very clean commit log like:
jira/issue-2: Do that
These are more changes.
jira/issue-1: Do this
These are the changes.
How do you enforce rebasing?
It's a setting in GitLab per project.
Settings > General > Merge Requests.
Under Merge method, select "Fast-forward merge".
Description is: "No merge commits are created. Fast-forward merges only. When conflicts arise the user is given the option to rebase."