Skip to content

Commit 5ffb1b8

Browse files
committed
docs: add detailed git steps for submitting PR and syncing branches in CONTRIBUTING (#1330)
**Motivation:** add detailed git steps for submitting PR and syncing branches in CONTRIBUTING **Modifications:** include detailed git steps for submitting PR and syncing branches in CONTRIBUTING **Result:** include detailed git steps for submitting PR and syncing branches in CONTRIBUTING
1 parent 74b876a commit 5ffb1b8

File tree

1 file changed

+35
-16
lines changed

1 file changed

+35
-16
lines changed

CONTRIBUTING.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,41 +136,60 @@ upstream https://github.com/Layr-Labs/eigenlayer-contracts.git (fetch)
136136
upstream https://github.com/Layr-Labs/eigenlayer-contracts.git (push)
137137
```
138138

139-
### Make Sure Your Fork Is In Sync With Upstream
140139

141-
Go to `main` branch in your fork repository
140+
### Create Your PR to Upstream Branches
141+
142+
The following applies if you submit a PR to upstream branch of either `main` or `release-dev/*`, which will refer to as `<upstream-target-branch>`
143+
144+
Create a local branch from the upstream branch:
142145

143146
```
144-
git checkout main
147+
git checkout -B <my-local-feature-branch> upstream/<upstream-target-branch>
145148
```
146149

147-
Fetch latest update from upstream
150+
Make your changes, then commit:
148151

149152
```
150-
git fetch upstream
153+
git add .
154+
git commit -m "your message"
151155
```
152156

153-
Rebase your `main` to the upstream `main`
157+
Push to your fork:
154158

155159
```
156-
git rebase upstream/main
160+
git push -u origin <my-local-feature-branch>
157161
```
158162

159-
Push to your fork repository
163+
Go to GitHub, and open a PR from:
160164

161165
```
162-
git push
166+
your-fork:<my-local-feature-branch>
167+
**to**
168+
Layr-Labs/eigenlayer-contracts:<upstream-target-branch>
163169
```
164170

165-
Now `main` in your fork repository should match the `main` in EigenLayer repository.
171+
GitHub should auto-detect this if branches match.
172+
173+
If you already have an open PR for this branch, just push more commits to `<my-local-feature-branch>`, and the PR will update.
174+
175+
176+
### Keeping Your Branch Updated With Upstream
177+
178+
To stay in sync with upstream's `<upstream-target-branch>`, whether it's `main` or `release-dev/*`:
179+
180+
```
181+
git fetch upstream
182+
git checkout <my-local-feature-branch>
183+
git rebase upstream/<upstream-target-branch>
184+
185+
# or use merge if you prefer
186+
# git merge upstream/<upstream-target-branch>
187+
188+
git push -f origin <my-local-feature-branch>
189+
```
166190

167-
### Create Your PR
191+
Use --force only if you're rebasing (not with merges).
168192

169-
1. Create a new branch from your target upstream branch in your fork repository
170-
2. Make your code changes
171-
3. Commit your changes
172-
4. Push to your forked repository
173-
5. Create a PR from your branch to the appropriate branch in the upstream repository
174193

175194
### PR Title Format
176195

0 commit comments

Comments
 (0)