Skip to content

Commit

Permalink
Added explanation on how to combine commits and fixed the PR template…
Browse files Browse the repository at this point in the history
… link
  • Loading branch information
mehdiataei committed Nov 4, 2024
1 parent 2f75108 commit 2541709
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Contributing Guidelines

<!-- Please make sure you have read and understood our contributing guidelines before submitting this PR -->
- [ ] I have read and understood the [CONTRIBUTING.md](../CONTRIBUTING.md) guidelines
- [ ] I have read and understood the [CONTRIBUTING.md](https://github.com/Autodesk/XLB/blob/main/CONTRIBUTING.md) guidelines


## Description
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ If you would like to contribute your code to XLB, you should:

When you submit your code, please include relevant tests as part of the pull request, and ensure that your comments and coding style align with the rest of the project. You can refer to the existing code for examples of the testing and style practices that the project follows.

Important: Ensure that your commits are atomic and self-contained. Each PR should only make a single, cohesive change. You should also squash your commits into a single commit as described below before submitting your PR.

## Detailed Contribution Guidelines

### 1. Setup Your Local Environment
Expand Down Expand Up @@ -116,6 +118,26 @@ When you submit your code, please include relevant tests as part of the pull req

This will let you update the commit message or include additional changes in a single commit.

To consolidate your existing commits into a single PR, first, you need to reset your branch to the point where you want the single commit to start from (likely the last commit on origin/main before your work began).

```bash
git reset --soft <commit-id>
```

Replace `<commit-id>` with the hash of the commit that should be the base of your PR (it is likely the last commit on origin/main before your changes, use that ID).

Now, all your work will be staged as if it’s a single set of changes. You can commit this with a new message that represents the combined work.

```bash
git commit -m "Combined changes"
```

Finally, you can push your changes to your fork with the following command:

```bash
git push --force origin <feature_branch_name>
```

### 5. Pushing Your Branch and Creating a Pull Request

- **Push Your Branch to Your Fork:**
Expand Down

0 comments on commit 2541709

Please sign in to comment.