Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Resynchronizing Your Branch including submodules #19268

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/newbs_git_resynchronize_a_branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ git remote set-url origin https://github.com/<your_username>/qmk_firmware.git
Now that you have both remotes configured, you need to update the references for the upstream repository, which is QMK's, by running:

```
git fetch upstream
git fetch --recurse-submodules upstream
```

At this point, resynchronize your branch to QMK's by running:

```
git reset --hard upstream/master
git reset --recurse-submodules --hard upstream/master
```

These steps will update the repository on your computer, but your GitHub fork will still be out of sync. To resynchronize your fork on GitHub, you need to push to your fork, instructing Git to override any remote changes that are not reflected in your local repository. To do this, run:

```
git push --force-with-lease
git push --recurse-submodules=on-demand --force-with-lease
```

!> **DO NOT** run `git push --force-with-lease` on a fork to which other users post commits. This will erase their commits.
!> **DO NOT** run `git push --recurse-submodules=on-demand --force-with-lease` on a fork to which other users post commits. This will erase their commits.

Now your GitHub fork, your local files, and QMK's repository are all the same. From here you can make further needed changes ([use a branch!](newbs_git_using_your_master_branch.md#making-changes)) and post them as normal.