Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added explanation on how to combine commits and fixed the PR template link #88

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading