Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28de5c2
commit 29ddd2b
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
id: contributing_git | ||
title: Git commands for contributors | ||
sidebar_label: Git Commands | ||
--- | ||
|
||
While we're mostly used to working with source control, working with a fork and making sure | ||
we can merge swiftly brings some additional challenges. This page aims to help you out with the things you might | ||
get asked to do, but may be outside of your comfort zone. | ||
|
||
Sit back, relax and bring your towel. | ||
|
||
## I didn't stick to the conventional commit guidelines | ||
|
||
### I only have 1 commit | ||
|
||
To reword the last commit, we can make use of git's `--amend` switch to add something to our latest commit (code, changes, rewording). | ||
Use the following comands to rephrase the last commit and get that change merged! | ||
|
||
```bash | ||
git commit --amend -m "feat: better worded feature"` | ||
git push --force | ||
``` | ||
|
||
### I added more than commit | ||
|
||
If all of your commits need to go to main because it makes sense to treat these as atomic units, you can use git's interactive rebase | ||
functionality to reword any commit between `main` and your `HEAD`. To start an interactive rebase, type `git rebase -i main`. | ||
This will open your `$EDITOR` and you can mark the commits you want to reword with `reword` (or `r`) rather than `pick`. | ||
Exiting that file will start the rebase and spwan your `$EDITOR` to alter the commit message for each commit you marked as `reword`. | ||
Once done, use `git push --force` to bring the changes to the pull request. | ||
:::info vscode | ||
The latest version of vscode has a built-in gui to help you select `reword` or any other action on a commit. Select the right ones and press | ||
Start Rebase to continue. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters