diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44217d2da5..4e7a59d5a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,7 +80,7 @@ get going: git add add-this-doc.md git commit -s -m "Added a shiny new doc." ``` - + For more details, please refer to [DCO](docs/developer/Supplemental_developer_guide.md#DCO) 11. Push from your branch (for example, `doc-updates`) to **the relevant branch on your fork on GitHub:** diff --git a/docs/developer/Supplemental_developer_guide.md b/docs/developer/Supplemental_developer_guide.md new file mode 100644 index 0000000000..8670f231a5 --- /dev/null +++ b/docs/developer/Supplemental_developer_guide.md @@ -0,0 +1,87 @@ +--- +title: Supplementary Developer Contribution Guidelines +sidebar_position: 8 +--- + +# Supplementary Developer Contribution Guidelines: + + +## DCO + + +DCO (Developer Certificate of Origin) needed for each commit, contributors must sign off on their commits to certify that they have the right +to submit the code they are contributing. This is done using `--signoff` option in Git. + +The sign-off is a simple line at the end of the commit message, which looks like this: + +``` + Signed-off-by: Your Name +``` + +You can add this automatically to your commit message using the `-s` or `--signoff` + +flag when you make a commit,here are the steps to follow so the computer can add it for you: + +**Set your legal name in the git configuration:** + +``` + git config user.name "Legal Name" +``` + +**Set your email in the git configuration:** + +``` + git config user.email "your.email@example.com" +``` + +**Add the -s or --signoff to all git commit invocations.** + +``` + git commit -s -m "Your commit message" +``` + +**Add above signoff line for last unsigned commit** + +``` + git commit -s --amend +``` + + +## Ensuring to squash similiar commits + + +To ensure that your pull request does not contain multiple similiar commits, you may need to squash your commits. + +Here's how to do it: + +**Rebase Your Branch:** + +Rebase your feature branch onto the latest version of the target branch + +``` + git checkout feature-branch + git fetch origin + git rebase origin/master +``` + +**Squash Commits:** + +Interactive rebase to squash commits: + +``` + git rebase -i HEAD~N +``` + +Replace 'N' with the number of similiar commits you want to squash. In the interactive rebase interface, + +Replace 'pick' with 'squash' for all commits except the first one. And amend the commit message if needed. + +**Force Push:** + +After squashing your commits, force push your branch to update your pull request: + +``` + git push -f +``` + +