Skip to content

Commit d2c15c8

Browse files
committed
Added contributing detailed instructions
1 parent cc33309 commit d2c15c8

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Contributing Guidelines
2+
3+
<!-- 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
5+
6+
17
## Description
28

39
<!--

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,128 @@ If you would like to contribute your code to XLB, you should:
3838

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.
41+
42+
## Detailed Contribution Guidelines
43+
44+
### 1. Setup Your Local Environment
45+
46+
- **Clone Your Fork:**
47+
If you haven't yet cloned your copy of the repository, you can do so with the following command:
48+
49+
```bash
50+
git clone https://github.com/Autodesk/XLB
51+
cd XLB
52+
```
53+
54+
- **Add Upstream Remote:** Set up the upstream remote to track the original repository.
55+
56+
```bash
57+
git remote add upstream https://github.com/Autodesk/XLB
58+
```
59+
60+
You can check your remotes to ensure everything is set up correctly:
61+
62+
```bash
63+
git remote -v
64+
```
65+
66+
### 2. Syncing Your Main Branch with Upstream
67+
68+
- **Fetch Updates from Upstream:**
69+
To keep your local repository up to date with the upstream `main` branch:
70+
71+
```bash
72+
git fetch upstream
73+
```
74+
75+
- **Sync Your Main Branch:**
76+
Checkout to your local `main` and merge the upstream changes to ensure it's always up to date:
77+
78+
```bash
79+
git checkout main
80+
git merge upstream/main
81+
```
82+
83+
- **Push to Your Fork (Optional):**
84+
It is a good practice to also keep the fork on GitHub in sync:
85+
86+
```bash
87+
git push origin main
88+
```
89+
90+
### 3. Create a Feature Branch for Your Contribution
91+
92+
- **Create and Checkout a New Branch:**
93+
Always work on a new branch for each feature or issue to keep things organized:
94+
```bash
95+
git checkout -b <feature_branch_name>
96+
```
97+
Choose a descriptive branch name that makes it clear what your contribution is.
98+
99+
### 4. Make Your Changes
100+
101+
- **Make Changes and Commit:**
102+
Make all the changes you need, then stage and commit them:
103+
104+
```bash
105+
git add .
106+
git commit -m "Description of the changes made"
107+
```
108+
109+
- **Amend or Squash Commits (Optional):**
110+
If you need to update the commit message or add more changes before pushing, you can amend your commit:
111+
112+
```bash
113+
git add .
114+
git commit --amend
115+
```
116+
117+
This will let you update the commit message or include additional changes in a single commit.
118+
119+
### 5. Pushing Your Branch and Creating a Pull Request
120+
121+
- **Push Your Branch to Your Fork:**
122+
123+
```bash
124+
git push origin <feature_branch_name>
125+
```
126+
127+
- **Create a Pull Request (PR):**
128+
Go to the repository on GitHub, and you should see an option to create a Pull Request from your recently pushed branch. Follow the steps to create the PR.
129+
130+
### 6. Handling Feedback and Updating PR
131+
132+
- **Make Changes Based on Feedback:**
133+
If changes are requested in the PR, make those changes in your local branch and amend the commit if needed:
134+
```bash
135+
git add .
136+
git commit --amend
137+
git push --force origin <feature_branch_name>
138+
```
139+
The `--force` flag is necessary because you amended an existing commit, and you need to update the remote branch accordingly.
140+
141+
### 7. Finalizing and Merging
142+
143+
- **Squash Commits on Maintainer Side:**
144+
When the PR is ready to be merged, the maintainer *will* squash multiple commits into a single one, or you can amend and force push until only a single commit is present.
145+
146+
- **Sync Your Fork Main Branch Again:**
147+
Once your PR is merged, make sure to sync your local and forked `main` branch again:
148+
149+
```bash
150+
git checkout main
151+
git fetch upstream
152+
git merge upstream/main
153+
git push origin main
154+
```
155+
156+
### 8. Start a New Contribution
157+
158+
- **Create a New Branch:**
159+
For each new contribution, repeat the branching step:
160+
```bash
161+
git checkout main
162+
git checkout -b <new_feature_branch>
163+
```
164+
---
165+
This workflow ensures every contribution is separate and cleanly managed.

0 commit comments

Comments
 (0)