2024-09-24 08:56:37 +00:00
|
|
|
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js";
|
2024-05-30 02:02:10 +00:00
|
|
|
|
const __pageData = JSON.parse(`{"title":"Your Fork's Master: Update Often, Commit Never","description":"","frontmatter":{},"headers":[],"relativePath":"newbs_git_using_your_master_branch.md","filePath":"newbs_git_using_your_master_branch.md"}`);
|
|
|
|
|
const _sfc_main = { name: "newbs_git_using_your_master_branch.md" };
|
|
|
|
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="your-fork-s-master-update-often-commit-never" tabindex="-1">Your Fork's Master: Update Often, Commit Never <a class="header-anchor" href="#your-fork-s-master-update-often-commit-never" aria-label="Permalink to "Your Fork's Master: Update Often, Commit Never""></a></h1><p>It is highly recommended for QMK development, regardless of what is being done or where, to keep your <code>master</code> branch updated, but <em><strong>never</strong></em> commit to it. Instead, do all your changes in a development branch and issue pull requests from your branches when you're developing.</p><p>To reduce the chances of merge conflicts — instances where two or more users have edited the same part of a file concurrently — keep your <code>master</code> branch relatively up-to-date, and start any new developments by creating a new branch.</p><h2 id="updating-your-master-branch" tabindex="-1">Updating your master branch <a class="header-anchor" href="#updating-your-master-branch" aria-label="Permalink to "Updating your master branch""></a></h2><p>To keep your <code>master</code> branch updated, it is recommended to add the QMK Firmware repository ("repo") as a remote repository in git. To do this, open your Git command line interface and enter:</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.com/qmk/qmk_firmware.git</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The name <code>upstream</code> is arbitrary, but a common convention; you can give the QMK remote any name that suits you. Git's <code>remote</code> command uses the syntax <code>git remote add <name> <url></code>, <code><name></code> being shorthand for the remote repo. This name can be used with many Git commands, including but not limited to <code>fetch</code>, <code>pull</code> and <code>push</code>, to specify the remote repo on which to act.</p></div><p>To verify that the repository has been added, run <code>git remote -v</code>, which should return the following:</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 -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>Now that this is done, you can check for updates to the repo by running <code>git fetch upstream</code>. This retrieves the branches and tags — collectively referred to as "refs" — from the QMK repo, which now has the nickname <code>upstream</code>. We can now compare the data on our fork <code>origin</code> to that held by QMK.</p><p>To update your fork's master, run the following, hitting the Enter key after each line:</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 checkout master</span></span>\n<span class="line"><span>git fetch upstream</span></span>\n<span class="line"><span>git pull upstream master</span></span>\n<span class="line"><span>git push origin master</span></span></code></pre></div><p>This switches you to your <code>master</code> branch, retrieves the refs from the QMK repo, downloads the current QMK <code>master</code> branch to your compute
|
|
|
|
|
const _hoisted_28 = [
|
|
|
|
|
_hoisted_1
|
|
|
|
|
];
|
|
|
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
|
|
return openBlock(), createElementBlock("div", null, _hoisted_28);
|
|
|
|
|
}
|
|
|
|
|
const newbs_git_using_your_master_branch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
|
|
|
export {
|
|
|
|
|
__pageData,
|
|
|
|
|
newbs_git_using_your_master_branch as default
|
|
|
|
|
};
|