Skip to content

Commit

Permalink
rebase your feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bjelline committed Mar 18, 2024
1 parent 1ff8eb5 commit 4dc2b3a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
10 changes: 5 additions & 5 deletions assets/images/git_branch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/images/git_merge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions source/documents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
- name: Internationalization (I18n)
url: internationalization.html
description: How to prepare you app for many languages, many countries
- name: Git Rebasing
url: git_rebasing.html
description: How to work with feature branches and rebasing in git
- name: Nodes.js
documents:
- name: Node vs. Rails
Expand Down
16 changes: 15 additions & 1 deletion source/git_rebasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ a few commits W, X, Y, and Z to it, it might look like this:

If you merge back into main now everything will be fine.

But what if the main moves on?
But what if the main branch moves on?


### Merging two branches
Expand Down Expand Up @@ -61,6 +61,20 @@ After the rebase a merge into main will be simple.

### Rebase your feature branch

When working with feature branches you try to merge as fast as possible.
But if the main branch moves on while you are working on your feature,
you can use `git rebase` to catch up:


```shell
git fetch
git checkout a3
git pull origin a3
git rebase main
# fix problems, run test, fix problems again
git push -f origin a3 # overwrite branch with rebased branch
# work on your merge request
```


### Resources
Expand Down

0 comments on commit 4dc2b3a

Please sign in to comment.