Skip to content

Commit

Permalink
Add Supplemental Developer Contribution Guidelines
Browse files Browse the repository at this point in the history
Signed-off-by: Xue Mingdi <[email protected]>
  • Loading branch information
xuemingdi committed Aug 1, 2024
1 parent c591a8b commit a2d8c64
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
87 changes: 87 additions & 0 deletions docs/developer/Supplemental_developer_guide.md
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
```

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 "[email protected]"
```

**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
```


0 comments on commit a2d8c64

Please sign in to comment.