Skip to content

Commit 2541709

Browse files
committed
Added explanation on how to combine commits and fixed the PR template link
1 parent 2f75108 commit 2541709

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Contributing Guidelines
22

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

66

77
## Description

CONTRIBUTING.md

+22
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ If you would like to contribute your code to XLB, you should:
3939

4040
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.
4141

42+
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.
43+
4244
## Detailed Contribution Guidelines
4345

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

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

121+
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).
122+
123+
```bash
124+
git reset --soft <commit-id>
125+
```
126+
127+
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).
128+
129+
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.
130+
131+
```bash
132+
git commit -m "Combined changes"
133+
```
134+
135+
Finally, you can push your changes to your fork with the following command:
136+
137+
```bash
138+
git push --force origin <feature_branch_name>
139+
```
140+
119141
### 5. Pushing Your Branch and Creating a Pull Request
120142

121143
- **Push Your Branch to Your Fork:**

0 commit comments

Comments
 (0)