From 3173522a005e310ca3a6fe7f0bba037a35d38326 Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 23 Oct 2023 11:02:40 +0200 Subject: [PATCH] docs(rebase): write a rebase doc --- .../content/docs/guides/create-challenge.md | 6 +- docs/src/content/docs/guides/rebase.md | 55 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 docs/src/content/docs/guides/rebase.md diff --git a/docs/src/content/docs/guides/create-challenge.md b/docs/src/content/docs/guides/create-challenge.md index 224758b..b4bb0f4 100644 --- a/docs/src/content/docs/guides/create-challenge.md +++ b/docs/src/content/docs/guides/create-challenge.md @@ -25,7 +25,7 @@ To streamline the process, I have created an Nx generator that will set up all t - challengeDifficulty: The difficulty you think your challenge has. There are three difficulty levels : 🟢 easy / 🟠 medium / 🔴 hard - name: name of the Nx application. :::note - It must be written in **Kebab-Case** + It must be written in **kebab-case** ::: - docRepository: The category of your Challenge: Nx, Angular, Angular Performance, Rxjs, NgRx, Typescript. @@ -48,3 +48,7 @@ Don't forget to update the docs to introduce your challenge and provide your ins ::: It's your turn to act!!! 💪 + +## Solution Submittion + +After one week or so, don't forget to provide your solution to your challenge. diff --git a/docs/src/content/docs/guides/rebase.md b/docs/src/content/docs/guides/rebase.md new file mode 100644 index 0000000..782c616 --- /dev/null +++ b/docs/src/content/docs/guides/rebase.md @@ -0,0 +1,55 @@ +--- +title: Rebase your branch +description: Guide to rebase a branch to latest change +sidebar: + order: 6 +--- + +Sometimes, changes may be added to the project. I'll attempt to make changes that won't break anything, but sometimes it's inevitable. + +Most of the time, you won't need to rebase your solution, but here is a guide to help you know how to do it. + +:::note +This guide is applicable to any Open Source Project. +::: + +## Steps to rebase your branch + +### Sync your repository + +First, you need to synchronize your fork to ensure it's up to date with the forked repository. + +You can achieve this by clicking the Sync fork button on the main page of your fork. + +![Sync project header](../../../assets/fork-sync.png) + +The image above shows that my branch is behind of the main branch by 8 commits, and I need to synchronize it to be up to date. + +![Sync project update modal](../../../assets/sync-fork-update.png) + +### Open a terminal + +Open any terminal of your choice, either the one from your favorite IDE or a standalone instance. + +### Git + +Follow the following commands to rebase your local branch: + +- git checkout main +- git pull +- git checkout [your branch] +- git rebase main +- Resolve Conflicts + +At this step, the rebase may stop because your local branch has conflicting files with the main branch. Correct them. After this is done: + +- git add . +- git rebase --continue + +If your branch doesn't have any conflicts, a success message will be shown. + +### Push your work back to the remote branch + +Finally, push your work back to GitHub: + +- git push -f