<spanclass="line"><span>upstream https://github.com/qmk/qmk_firmware.git (push)</span></span></code></pre></div><p>If you only see one fork referenced:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>QMKuser ~/qmk_firmware (master)</span></span>
<spanclass="line"><span>origin https://github.com/qmk/qmk_firmware.git (push)</span></span></code></pre></div><p>add a new remote with:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>git remote add upstream https://github.com/qmk/qmk_firmware.git</span></span></code></pre></div><p>Then, redirect the <code>origin</code> remote to your own fork with:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>git remote set-url origin https://github.com/<your_username>/qmk_firmware.git</span></span></code></pre></div><p>Now that you have both remotes configured, you need to update the references for the upstream repository, which is QMK's, by running:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>git fetch --recurse-submodules upstream</span></span></code></pre></div><p>At this point, resynchronize your branch to QMK's by running:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>git reset --recurse-submodules --hard upstream/master</span></span></code></pre></div><p>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:</p><divclass="language- vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang"></span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><span>git push --recurse-submodules=on-demand --force-with-lease</span></span></code></pre></div><divclass="warning custom-block"><pclass="custom-block-title">WARNING</p><p><strong>DO NOT</strong> run <code>git push --recurse-submodules=on-demand --force-with-lease</code> on a fork to which other users post commits. This will erase their commits.</p></div><p>Now your GitHub fork, your local files, and QMK's repository are all the same. From here you can make further needed changes (<ahref="./newbs_git_using_your_master_branch#making-changes">use a branch!</a>) and post them as normal.</p></div></div></main><footerclass="VPDocFooter"data-v-39a288b8data-v-09de1c0f><!--[--><!--]--><!----><navclass="prev-next"data-v-09de1c0f><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link prev"href="/newbs_git_resolving_merge_conflicts"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Previous page</span><spanclass="title"data-v-09de1c0f>Merge Conflicts</span><!--]--></a></div><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link next"href="/keycodes"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Next page</span><spanclass="title"data-v-09de1c0f>Full List</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>