Skip to content

Commit 5cd64b4

Browse files
committed
doc: add info on syncing to origin/main and rebasing
1 parent b2262e0 commit 5cd64b4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ apk
1414
Args
1515
asn
1616
asottile
17+
atlassian
1718
autoescape
1819
autoextract
1920
autoextracts

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ git pull
230230
git checkout -b my_new_branch
231231
```
232232

233+
>Note: If you accidentally check something in to main and want to reset it to match our main branch, you can save your work using `checkout -b` and then do a `git reset` to fix it:
234+
>```
235+
>git checkout -b saved_branch
236+
>git reset --hard origin/main
237+
>```
238+
>You do not need to do the `checkout` step if you don't want to save the changes you made.
239+
233240
When you're ready to share that branch to make a pull request, make sure you've checked in all the files you're working on. You can get a list of the files you modified using `git status` and see what modifications you made using `git diff`
234241
235242
Use `git add FILENAME` to add the files you want to put in your pull request, and use `git commit` to check them in. Try to use [a clear commit message](https://chris.beams.io/posts/git-commit/) and use the [Conventional Commits](https://www.conventionalcommits.org/) format.
@@ -279,6 +286,8 @@ Someone will review your code and try to provide feedback in the comments on Git
279286

280287
If something needs fixing or we have questions, we'll work back and forth with you to get that sorted. We usually do most of the chatting directly in the pull request comments on GitHub, but if you're stuck you can also stop by our [Gitter chat room](https://gitter.im/cve-bin-tool/community) to talk with folk outside of the bug.
281288

289+
>Another useful tool is `git rebase`, which allows you to change the "base" that your code uses. We most often use it as `git rebase origin/main` which can be useful if a change in the main tree is affecting your code's ability to merge. Rebasing is a bit much for an intro document, but [there's a git rebase tutorial here](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) that you may find useful if it comes up.
290+
282291
Once any issues are resolved, we'll merge your code. Yay!
283292

284293
In rare cases, the code won't work for us and we'll let you know. Sometimes this happens because someone else has already submitted a fix for the same bug, (Issues marked [good first issue](https://github.com/intel/cve-bin-tool/labels/good%20first%20issue) can be in high demand!) or because you worked on a checker that didn't have a good signature. Don't worry, these things happens, no one thinks less of you for trying!

0 commit comments

Comments
 (0)