qmk_firmware/assets/newbs_git_using_your_master_branch.md.B9DxZCl8.js

16 lines
8.4 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
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&#39;s Master: Update Often, Commit Never <a class="header-anchor" href="#your-fork-s-master-update-often-commit-never" aria-label="Permalink to &quot;Your Fork&#39;s Master: Update Often, Commit Never&quot;"></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&#39;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 &quot;Updating your master branch&quot;"></a></h2><p>To keep your <code>master</code> branch updated, it is recommended to add the QMK Firmware repository (&quot;repo&quot;) 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&#39;s <code>remote</code> command uses the syntax <code>git remote add &lt;name&gt; &lt;url&gt;</code>, <code>&lt;name&gt;</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/&lt;your_username&gt;/qmk_firmware.git (fetch)</span></span>\n<span class="line"><span>origin https://github.com/&lt;your_username&gt;/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 &quot;refs&quot; 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&#39;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
};