<?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: Erin Fox</title>
    <description>The latest articles on DEV Community by Erin Fox (@erinfoox).</description>
    <link>https://dev.to/erinfoox</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%2F57757%2F1c4c69ea-859a-4d76-a651-864fb4b441d9.JPG</url>
      <title>DEV Community: Erin Fox</title>
      <link>https://dev.to/erinfoox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erinfoox"/>
    <language>en</language>
    <item>
      <title>Extract, Transform and Load with React &amp; Rails</title>
      <dc:creator>Erin Fox</dc:creator>
      <pubDate>Mon, 20 Sep 2021 21:48:18 +0000</pubDate>
      <link>https://dev.to/erinfoox/extract-transform-and-load-with-react-rails-ggp</link>
      <guid>https://dev.to/erinfoox/extract-transform-and-load-with-react-rails-ggp</guid>
      <description>&lt;p&gt;You might be thinking, &lt;strong&gt;WFT is ETL and have I been using it all this time?!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're an engineer, you probably have done some form of ETL. I never realized I was extracting, transforming and loading data throughout my career until researching it recently. I also, need to get better at it and the best way I know how is by researching, practice and  writing about it.  &lt;/p&gt;

&lt;p&gt;I'm still working on learning it with more complicated data structures and data transformations, but I wanted to break it down to the beginning to make sure I understand it each step of the way. But with cats added. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is ETL?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ETL&lt;/strong&gt; = Extract, Transform, Load &lt;/p&gt;

&lt;p&gt;ETL is a series of steps to move data from one location to another. When doing this, it transforms the data structure before it is loaded from its source to its new destination. In more words, it is a process you can use to help plan and execute the movement of data that you need. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why use ETL?
&lt;/h2&gt;

&lt;p&gt;I'm sure there are several answers to this question. For me, using it breaks down the steps of gathering and retrieving data. It also forces you to understand the shape of the data, what data you need, and how eventually you want it to look before rendering it in your app, browser or database.&lt;/p&gt;

&lt;p&gt;A more fancier definition for why we use it: Data from different sources can be pulled together and restructured to a standardized format. &lt;/p&gt;

&lt;p&gt;Let's walk through each step of extracting, transforming and loading data with React and Rails. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gx36yjmojswv491t83u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gx36yjmojswv491t83u.png" alt="Mind map of ETL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extract - PLAN IT
&lt;/h2&gt;

&lt;p&gt;Extract, is all about planning for the transforming. There are 3 steps or questions to ask yourself to find the answers needed in order to move on to the next step, transform. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where is the data that I need? 

&lt;ul&gt;
&lt;li&gt;Get it locally from your routes file? &lt;/li&gt;
&lt;li&gt;From another endpoint or 3rd party API like 
the Spotify API?

&lt;ul&gt;
&lt;li&gt;For our example, we will use hardcoded 
code found in our controller.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  def cats
    render json: {
      cats: [ # Cat.all
        {
          name: "Maya",
          color: "calico",
          rating: "perfect",
          owners: [
            "Mark"
          ]
        },
        {
          name: "Sully",
          color: "seal bicolor",
          rating: "perfect",
          owners: [
            "Erin"
          ]
        }
      ]
    }
  end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;What specific information do I need from that data?"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decide what data to extract 

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;In our example, let's extract the 
colors of the cats. So we want to 
return only the colors.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What should I use to retrieve that data? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query/retrieve the data &lt;/li&gt;
&lt;li&gt;A fetch request with JS on the frontend? &lt;/li&gt;
&lt;li&gt;A &lt;code&gt;Net::HTTP&lt;/code&gt; with Ruby?

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;For our example, we will use &lt;code&gt;request&lt;/code&gt; 
which is a custom little thing we built 
internally. It is build off JS fetch.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This &lt;code&gt;handleGet&lt;/code&gt; function is the main way we will extract and receive the data we need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  async function handleGet() {
    const response = await request("/some-cool-route/cats") // built off js fetch, so this is a GET request
    console.log("handleGet", response)
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And our console log, would look like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fridrj59nk2g3odsi1fp7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fridrj59nk2g3odsi1fp7.png" alt="Console.log response"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Transform - DO IT
&lt;/h2&gt;

&lt;p&gt;Now that we have learned where the data is (in a method within the controller), what part of it we need (the cat's colors) and how to retrieve the data (a fetch GET request using an internal tool we use) we can now start changing the data to the shape we want. We can restructure it, rename it, remove things we don't need and even add values. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What should the data structure look like? 

&lt;ul&gt;
&lt;li&gt;Since our example is small, we are looking 
&lt;em&gt;only&lt;/em&gt; to return the cat's colors. We don't 
need the name, rating or owners.

&lt;ul&gt;
&lt;li&gt;We would want our transformed data to 
look like this if we were to console log it. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fat4ws558y1e1ngta5ozm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fat4ws558y1e1ngta5ozm.png" alt="Console.log of the 2 cat colors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can transform the cats array, to return only the cat colors by creating a function that takes the data (cat's array) and returns a new data structure (an array of cat colors).&lt;/p&gt;

&lt;p&gt;With our data in a method in our controller, let's look at our react component that will render the page. &lt;/p&gt;

&lt;p&gt;This is were we can create a transform function &lt;code&gt;transformColors()&lt;/code&gt; that will return an array of each cat's color: ["calico", "seal bicolor"]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function transformColors(cats) {
  return cats.map(cat =&amp;gt; cat.color)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Load / Render - SHOW IT
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Where should the data then be loaded or rendered? 

&lt;ul&gt;
&lt;li&gt;Add it to the database or display it to the 
user&lt;/li&gt;
&lt;li&gt;In some situations, you may be adding this 
new array of cat colors to your database. &lt;/li&gt;
&lt;li&gt;I mostly work with rendering the data to 
the page with React components, so let's see it all play out that way. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the react component rendering our new transformed data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from "react"
import { request } from "react-rb" // internal tool by CK

export default function Meow() {
  const [cats, setCats] = useState([])
  const [colors, setColors] = useState([])

  async function handleGet() {
// EXTRACT
    const response = await request("/some-cool-route/cats") // built off js fetch, so this is a GET request
    setCats(response.data.cats)

    const transformCatColors = transformColors(response.data.cats)
    setColors(transformCatColors)
  }

  return (
    &amp;lt;div className="m-8"&amp;gt;
      &amp;lt;button onClick={handleGet}&amp;gt;Get cat colors 🐈 🐈‍⬛&amp;lt;/button&amp;gt;
// LOAD/RENDER
      &amp;lt;div&amp;gt;{colors}&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}
// TRANSFORM 
function transformColors(cats) {
  return cats.map(cat =&amp;gt; &amp;lt;div key={cat.color}&amp;gt;{cat.color}&amp;lt;/div&amp;gt;)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's recap. We have &lt;strong&gt;Extracted&lt;/strong&gt; the data from our controller using a fetch request. We then &lt;strong&gt;Transformed&lt;/strong&gt; that data to return only the cat colors with our &lt;code&gt;transformColors()&lt;/code&gt; function. And finally, we can &lt;strong&gt;Load/Render&lt;/strong&gt; it to the page in our React component in the JSX. &lt;/p&gt;

&lt;p&gt;Here's a gif it it all working! It is not pretty, but hopefully you get the idea. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FioDgx0riJAzR1NKzr1%2Fgiphy.gif%3Fcid%3D790b7611f059b641b5f0ff113180651f88bec5f851ac221c%26rid%3Dgiphy.gif%26ct%3Dg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FioDgx0riJAzR1NKzr1%2Fgiphy.gif%3Fcid%3D790b7611f059b641b5f0ff113180651f88bec5f851ac221c%26rid%3Dgiphy.gif%26ct%3Dg" alt="Gif of button being clicked to render the cat name and color"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully this small example helps explain ETL just a little but more!&lt;/p&gt;

&lt;p&gt;A big shoutout to my coworker &lt;a href="https://twitter.com/mtmdev_" rel="noopener noreferrer"&gt;Mark M.&lt;/a&gt; for helping me grasp this concept even further and for setting up this awesome cat example. &lt;/p&gt;

</description>
      <category>etl</category>
      <category>react</category>
      <category>rails</category>
      <category>cats</category>
    </item>
    <item>
      <title>NOTES: Merge or Rebase</title>
      <dc:creator>Erin Fox</dc:creator>
      <pubDate>Tue, 15 Dec 2020 22:33:56 +0000</pubDate>
      <link>https://dev.to/erinfoox/merge-or-rebase-1a65</link>
      <guid>https://dev.to/erinfoox/merge-or-rebase-1a65</guid>
      <description>&lt;p&gt;Recently, I learned that merging a main branch, into your local working branch is a thing 🤯. I was shocked that I just learned about this in my 3+ years of being an engineer. BUT it's never too late to learn. (And take notes for when you forget).&lt;/p&gt;

&lt;p&gt;Before, I would always copy/paste my rebase notes from my Notion into my terminal, cross my fingers with selecting the correct "accepting incoming" changes. "blue is you" theories, hope the correct version is added, continued and then force pushed. Sounds scary... but it worked! &lt;/p&gt;

&lt;p&gt;From what I understand, merging main into your branch and rebasing from master results in the same goal: The latest most up to date code on your branch with your new feature code. &lt;/p&gt;

&lt;p&gt;Merging sounds better to me. At least, it makes more sense, visually. Gelling together all the code, vs dumping it on top, &lt;em&gt;feels&lt;/em&gt; better. I needed to learn how to gel instead of dump.&lt;/p&gt;

&lt;p&gt;So, let's gel. &lt;/p&gt;

&lt;p&gt;Here are my merge and rebase notes. Be aware that these work for me, and may not do exactly what you're hoping for. Chat with your team and do more research when you're learning this.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;MERGING&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Merging takes the content of the main branch and integrates it with your branch. Only your branch is changing. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl8pkh3kvmldtwjkw5nep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl8pkh3kvmldtwjkw5nep.png" alt="Merge Master --&amp;gt; Feature Branch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's do it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;merge&lt;/span&gt; &lt;span class="nx"&gt;main&lt;/span&gt;

&lt;span class="o"&gt;~~&lt;/span&gt;&lt;span class="nx"&gt;another&lt;/span&gt; &lt;span class="nx"&gt;way&lt;/span&gt;&lt;span class="o"&gt;~~&lt;/span&gt;

&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;merge&lt;/span&gt; &lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;REBASING&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Rebasing takes the content of the main branch into a single "patch" and integrates onto your branch. &lt;/p&gt;

&lt;p&gt;Apparently, rebasing incorrectly can unintentionally rewrite history. Which &lt;em&gt;sounds&lt;/em&gt; really cool, but also like the climax of a bad time travel movie where everything goes bad because they talked to that person they weren't suppose to talk too and now everything is ruined.&lt;/p&gt;

&lt;p&gt;For now, I'd like to not time travel until I understand it better.  &lt;/p&gt;

&lt;p&gt;It moves your entire branch on top of the main branch. It rewrites the project history by making new commits for each commit on your original branch. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk8sjlorafzau5t6ddesx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk8sjlorafzau5t6ddesx.png" alt="Rebase feature branch into master"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's do it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;pull&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="nx"&gt;main&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="nx"&gt;main&lt;/span&gt;

&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;conflicts&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt; &lt;span class="nx"&gt;when&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;are&lt;/span&gt; &lt;span class="nx"&gt;resolving&lt;/span&gt; &lt;span class="nx"&gt;conflicts&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;DO&lt;/span&gt; &lt;span class="nx"&gt;NOT&lt;/span&gt; &lt;span class="nx"&gt;COMMIT&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;

&lt;span class="nx"&gt;save&lt;/span&gt; &lt;span class="o"&gt;****&lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;changes&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;conflicts&lt;/span&gt; 

&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;

&lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt; 

&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="k"&gt;continue&lt;/span&gt;

&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;wq&lt;/span&gt; &lt;span class="c1"&gt;// or however you have your editor setup &lt;/span&gt;

&lt;span class="o"&gt;--&lt;/span&gt; &lt;span class="nx"&gt;repeat&lt;/span&gt; &lt;span class="nx"&gt;until&lt;/span&gt; &lt;span class="nx"&gt;no&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt; &lt;span class="nx"&gt;conflicts&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;EVEN&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;there&lt;/span&gt; &lt;span class="nx"&gt;are&lt;/span&gt; &lt;span class="nx"&gt;no&lt;/span&gt; &lt;span class="nx"&gt;conflicts&lt;/span&gt; 

&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;push&lt;/span&gt; &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Interactive Rebase
&lt;/h3&gt;

&lt;p&gt;Now this just sound wild. Taking it a step further, interactive rebasing allows altering the commits as they are moved to the new branch. This gives you more control over your branch's commit history. I've heard you use this type of rebase when things are really harry. &lt;/p&gt;

&lt;p&gt;Let's do it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt; &lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;rebase&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="nx"&gt;master&lt;/span&gt;

&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="nx"&gt;then&lt;/span&gt; &lt;span class="nx"&gt;open&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;editor&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;commits&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;are&lt;/span&gt; &lt;span class="nx"&gt;about&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;be&lt;/span&gt; &lt;span class="nx"&gt;moved&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; 
&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;where&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt; &lt;span class="nx"&gt;change&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;make&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;look&lt;/span&gt; &lt;span class="nx"&gt;like&lt;/span&gt; &lt;span class="nx"&gt;how&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;need&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alright. So now we've learned there are 3 options: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Merge &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automation rebase ("regular")&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interactive rebase&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Which one should you use? Great question. I'm still figuring that out, but it starts with understanding each of your options, and the situation that you're in. Do you need to rewrite history? Or will a merge be quicker and all you need?&lt;/p&gt;

&lt;p&gt;I believe it's best to chat with your team to hear their philosophies and approaches so everyone is on the same page. Hopefully, all y'all are not time traveling at the same time causing madness and talking to that person you're not suppose to talk to that changes the future.&lt;/p&gt;

</description>
      <category>merge</category>
      <category>rebase</category>
      <category>cheatsheet</category>
      <category>git</category>
    </item>
    <item>
      <title>Nevertheless, Erin Fox Coded</title>
      <dc:creator>Erin Fox</dc:creator>
      <pubDate>Fri, 02 Mar 2018 15:16:43 +0000</pubDate>
      <link>https://dev.to/erinfoox/nevertheless-erin-fox-coded--5e79</link>
      <guid>https://dev.to/erinfoox/nevertheless-erin-fox-coded--5e79</guid>
      <description>&lt;h2&gt;
  
  
  I began/continue to code because...
&lt;/h2&gt;

&lt;p&gt;I love the feeling of FINALLY getting something to work! Even if it took hundreds of attempts, finally getting it and understand it is such an amazing feeling. That is what keeps me going. &lt;/p&gt;

&lt;h2&gt;
  
  
  I recently overcame...
&lt;/h2&gt;

&lt;p&gt;getting my conference CFP's rejected. Even though none of them have been chosen, I still continue to enter them. You never know :) &lt;/p&gt;

&lt;h2&gt;
  
  
  I want to brag about...
&lt;/h2&gt;

&lt;p&gt;the tech talk's I've been giving! Next one will be with GraphQL NYC. &lt;/p&gt;

&lt;h2&gt;
  
  
  My advice for allies to support women who code is....
&lt;/h2&gt;

&lt;p&gt;show up and don't give up. There's too many times when I am the only female at a Meetup. We need to change that. If anyone needs a buddy to go with, I'm always in! Twitter= &lt;a class="mentioned-user" href="https://dev.to/erinfoox"&gt;@erinfoox&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wecoded</category>
    </item>
  </channel>
</rss>
