We seek to follow a culture of good practices related to our development process with git.
Below you will find some of the most used practices.
Follow these 7 rules:
- Separate the head from the body with a blank line
- Limit the headline to 50 characters
- Do not end the headline with a period
- Use the imperative mood in the headline (example: "Create" instead of "Created")
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Really good article about those rules: https://chris.beams.io/posts/git-commit/
This means you need to create commit messages using the following format:
type(subject): commit message
Keep in mind this will go to the changelog, so create a concise commit message related to your changes, remember that you can always use the commit message body to say more details about your changes:
type(subject): commit message some long commit body
Usually to see available types, check the
commitlint.config.js file on the root of your project, the
Fixed some UI on User Evolution on Woovi
style(user-evolution): fix the wrong color on feedback received chart
Fixed some wrong code on groups that were causing form submissions to always return errors:
fix(groups): add new Group form checking from the invalid return from mutation Was checking for mutation result BlaBlaResult, instead of BlaResult.
fix(subject) already says it's a fix, you don't need to start the commit message with
Another scenario is updating schemas, trying to update schemas as a separate commit, and using the commit message:
chore(schemas): update schemas
Try to stick to the format
[kind-of-change]/[what-is-being-changed] whenever possible.
To modify anything on
production, always open a PR first.
Many approvals, from Woovi devs, are required to merge a PR:
git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d
Or if you want to just remove the references to remote when they are deleted
git config --global fetch.prune true
git tag -l | xargs git tag -d git fetch --tags
git config --global help.autocorrect 1
git ls-files --deleted -z | xargs -0 git rm
[alias] lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit co = checkout ec = config --global -e cob = checkout -b cm = !git add -A && git commit -m st = status
To add this alias to your git command line, copy and paste it to
The main idea is to transfer a commit from branch A to branch B.
When to use?
Let's say you have committed to the wrong branch. A good way to copy and paste this commit to the right branch is to use
How to use?
First of all, run
git log in the source branch to see the commit sha1. Then, switch to the destination branch and run the following:
git cherry-pick commit_sha1
commit_sha1 is the sha1 string of the desired commit. If there aren't any conflicts, the changes will be applied.
Woovi is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.
If you want to work with us, we are hiring!