<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: paschdan</title>
    <description>The latest articles on DEV Community by paschdan (@paschdan).</description>
    <link>https://dev.to/paschdan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F228459%2F36ec851a-be12-4885-a2a7-e487db904afc.jpeg</url>
      <title>DEV Community: paschdan</title>
      <link>https://dev.to/paschdan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paschdan"/>
    <language>en</language>
    <item>
      <title>splitting a commit with npm changes - introduction</title>
      <dc:creator>paschdan</dc:creator>
      <pubDate>Wed, 16 Sep 2020 18:46:43 +0000</pubDate>
      <link>https://dev.to/paschdan/splitting-a-commit-with-npm-changes-introduction-5g83</link>
      <guid>https://dev.to/paschdan/splitting-a-commit-with-npm-changes-introduction-5g83</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In this series i will cover the techniques how to split a commit into multiple commits, while also maintaining npm packages in the commits.&lt;/p&gt;

&lt;p&gt;I will show the technique for multiple git clients.&lt;/p&gt;

&lt;p&gt;The first part of the series is the introduction, where we introduce the code, we are working with.&lt;/p&gt;

&lt;h1&gt;
  
  
  get to know the code
&lt;/h1&gt;

&lt;p&gt;for learning how to split, we have the following demo repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/paschdan/git-split-demo"&gt;https://github.com/paschdan/git-split-demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the project is a demo repository, where a &lt;a href="https://github.com/paschdan/git-split-demo/pull/1"&gt;pull request&lt;/a&gt; is stated, that installs the following packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;eslint - for linting our future javascript code&lt;/li&gt;
&lt;li&gt;eslint configuration for standardjs&lt;/li&gt;
&lt;li&gt;babel - to compile our source code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;additionally a first hello world module was added.&lt;/p&gt;

&lt;p&gt;unfortunately all this happened in one commit, and the maintainer of the repository would like the author of the PR to split his commit into multiple parts.&lt;/p&gt;

&lt;p&gt;Our Task and the Goal of this Series is: split the PR into the requested commits.&lt;/p&gt;

&lt;h2&gt;
  
  
  prerequisites
&lt;/h2&gt;

&lt;p&gt;to run the demo, you will at least need git and node12+&lt;/p&gt;

&lt;h2&gt;
  
  
  try out the demo
&lt;/h2&gt;

&lt;p&gt;To get started, we want to clone the demo repository and check out the pull request branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/paschdan/git-split-demo.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;next we want to switch to the branch of the PR, we want to edit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout add-npm-packages-in-one-commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;now we can install our npm dependencies to test the demo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;after the dependencies are installed, we can test our script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;this prints Hello World to the console, because we overrided the npm test command with &lt;code&gt;node lib/index.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the next chapter we will start to split this commit into multiple, with the command line git cli, so stay tuned.&lt;/p&gt;

</description>
      <category>git</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
