82 lines
3.7 KiB
HTML
82 lines
3.7 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="stylesheet" href="main.css" type="text/css" />
|
|
<link rel="stylesheet" href="blog.css" type="text/css" />
|
|
<link rel="alternate" type="application/rss+xml" title="Subscribe to this page..." href="feed.rss" />
|
|
<title>Trying out a pull request</title>
|
|
</head><body>
|
|
<div id="divbodyholder">
|
|
<div class="headerholder"><div class="header">
|
|
<div id="title">
|
|
<h1 class="nomargin"><a class="ablack" href="http://zigford.org/index.html">zigford.org</a></h1>
|
|
<div id="description"><a href="about.html">About</a><a href="links.html"> | Links</a><a href="scripts.html"> | Scripts</a><br>Sharing linux/windows scripts and tips</br></div>
|
|
</div></div></div>
|
|
<div id="divbody"><div class="content">
|
|
<!-- entry begin -->
|
|
<h3><a class="ablack" href="trying-out-a-pull-request.html">
|
|
Trying out a pull request
|
|
</a></h3>
|
|
<!-- bashblog_timestamp: #201910061210.45# -->
|
|
<div class="subtitle">October 06, 2019 —
|
|
Jesse Harris
|
|
</div>
|
|
<!-- text begin -->
|
|
<p>You've received a pull request on your repo. Before merging you want to see what
|
|
it looks like in your code base. Perhaps you will run some manual test or some
|
|
diffs from the command line here and there.</p>
|
|
<hr />
|
|
<p>You can find this information anywhere out there on the web. As always the
|
|
purpose of this blog is more of a notetaking for me, but the other angle I want
|
|
to cover is not the exact commands to type (That will be here too), but why you
|
|
are typing them.</p>
|
|
<h2 id="get-setup">Get setup</h2>
|
|
<p>You want to start off with a clean local repository. That might mean running a
|
|
<code>git pull</code>, a <code>git clone</code> or switching to the master branch using <code>git checkout</code>.</p>
|
|
<p>I'm checking out a PR for my <a href="https://github.com/zigford/snapd">snapd ebuild
|
|
repo</a></p>
|
|
<h2 id="what-information-will-you-need">What information will you need?</h2>
|
|
<p>You will need to know the GitHub authors account name and the branch that they
|
|
are making changes from.</p>
|
|
<h2 id="the-commands">The commands</h2>
|
|
<p>From here it's easy. Conceptually, we are <em>checking out</em> a local branch to
|
|
<em>pull</em> the changes into</p>
|
|
<pre><code> # localbranchname is a new branch where we will pull
|
|
# the PR. It can be named whatever
|
|
# master is the branch we want the new branch to be
|
|
# based off
|
|
|
|
git checkout -b <localbranchname> master
|
|
git pull <githubAddressToUsersFork>.git <branchTheyCommitedTo>
|
|
</code></pre>
|
|
<h2 id="merge-to-master">Merge to master</h2>
|
|
<p>Perhaps your happy with the change. Your very close to being able to merge the
|
|
PR to your master repo. Here is how you would do that.</p>
|
|
<ol>
|
|
<li><p><em>checkout</em> your master branch</p>
|
|
</li>
|
|
<li><p><em>merge</em> the local branch you created earlier</p>
|
|
</li>
|
|
<li><p><em>push</em> changes back up to the remote <em>origin</em></p>
|
|
<pre><code> git checkout master
|
|
git merge <localbranchname>
|
|
git push origin master
|
|
</code></pre>
|
|
</li>
|
|
</ol>
|
|
<p>Tags: <a href='tag_git.html'>git</a>, <a href='tag_github.html'>github</a></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- text end -->
|
|
<!-- entry end -->
|
|
</div>
|
|
<div id="footer">© <a href="http://twitter.com/zigford_org">Jesse Harris</a> — <a href="mailto:jesse@zigford.org">jesse@zigford.org</a><br/>
|
|
Generated with <a href="https://github.com/cfenollosa/bashblog">bashblog</a>, a single bash script to easily create blogs like this one</div>
|
|
</div></div>
|
|
</body></html>
|