mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
7.1 KiB
JavaScript
16 lines
7.1 KiB
JavaScript
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
|
|||
|
const __pageData = JSON.parse('{"title":"Resynchronizing an Out-of-Sync Git Branch","description":"","frontmatter":{},"headers":[],"relativePath":"newbs_git_resynchronize_a_branch.md","filePath":"newbs_git_resynchronize_a_branch.md"}');
|
|||
|
const _sfc_main = { name: "newbs_git_resynchronize_a_branch.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="resynchronizing-an-out-of-sync-git-branch" tabindex="-1">Resynchronizing an Out-of-Sync Git Branch <a class="header-anchor" href="#resynchronizing-an-out-of-sync-git-branch" aria-label="Permalink to "Resynchronizing an Out-of-Sync Git Branch""></a></h1><p>Suppose you have committed to your <code>master</code> branch, and now need to update your QMK repository. You could <code>git pull</code> QMK's <code>master</code> branch into your own, but GitHub will tell you that your branch is a number of commits ahead of <code>qmk:master</code>, which can create issues if you want to make a pull request to QMK.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>This document builds upon the concepts detailed in <a href="./newbs_git_using_your_master_branch">Your Fork's Master: Update Often, Commit Never</a>. If you are not familiar with that document, please read it first, then return here.</p></div><h2 id="backing-up-the-changes-on-your-own-master-branch-optional" tabindex="-1">Backing Up the Changes on Your Own Master Branch (Optional) <a class="header-anchor" href="#backing-up-the-changes-on-your-own-master-branch-optional" aria-label="Permalink to "Backing Up the Changes on Your Own Master Branch (Optional)""></a></h2><p>No one wants to lose work if it can be helped. If you want to save the changes you've already made to your <code>master</code> branch, the simplest way to do so is to simply create a duplicate of your "dirty" <code>master</code> branch:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>git branch old_master master</span></span></code></pre></div><p>Now you have a branch named <code>old_master</code> that is a duplicate of your <code>master</code> branch.</p><h2 id="resynchronizing-your-branch" tabindex="-1">Resynchronizing Your Branch <a class="header-anchor" href="#resynchronizing-your-branch" aria-label="Permalink to "Resynchronizing Your Branch""></a></h2><p>Now it's time to resynchronize your <code>master</code> branch. For this step, you'll want to have QMK's repository configured as a remote in Git. To check your configured remotes, run <code>git remote -v</code>, which should return something similar to:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>QMKuser ~/qmk_firmware (master)</span></span>\n<span class="line"><span>$ git remote -v</span></span>\n<span class="line"><span>origin https://github.com/<your_username>/qmk_firmware.git (fetch)</span></span>\n<span class="line"><span>origin https://github.com/<your_username>/qmk_firmware.git (push)</span></span>\n<span class="line"><span>upstream https://github.com/qmk/qmk_firmware.git (fetch)</span></span>\n<span class="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><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>QMKuser ~/qmk_firmware (master)</span></span>\n<span class="line"><span>$ git remote -v</span></span>\n<span class="line"><span>origin https://github.com/qmk/qmk_firmware.git (fetch)</span></span>\n<span class="line"><span>origin https://github.com/qmk/qmk_firmware.git (push)</span></span></code></pre></div><p>add a new remote with:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>git remote add upstream https://github.co
|
|||
|
const _hoisted_25 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_25);
|
|||
|
}
|
|||
|
const newbs_git_resynchronize_a_branch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
newbs_git_resynchronize_a_branch as default
|
|||
|
};
|