<?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: John J Davidson</title>
    <description>The latest articles on DEV Community by John J Davidson (@xuz99).</description>
    <link>https://dev.to/xuz99</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%2F360879%2F48e6262f-629f-4aac-b7e3-de1243339066.jpg</url>
      <title>DEV Community: John J Davidson</title>
      <link>https://dev.to/xuz99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xuz99"/>
    <language>en</language>
    <item>
      <title>HTML Email image cut in half?</title>
      <dc:creator>John J Davidson</dc:creator>
      <pubDate>Tue, 25 Apr 2023 08:24:05 +0000</pubDate>
      <link>https://dev.to/xuz99/html-email-image-cut-in-half-208a</link>
      <guid>https://dev.to/xuz99/html-email-image-cut-in-half-208a</guid>
      <description>&lt;h2&gt;
  
  
  TL:DR
&lt;/h2&gt;

&lt;p&gt;Set the line height of the container to 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;line-hieght&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might need to add “display: block;”&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Long version:
&lt;/h2&gt;

&lt;p&gt;If you are creating an HTML email that is to be sent to an Outlook email client, you may see in test emails that an image is being cut in half. Like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b3fZyR71--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0wq2usvmz6t1lm35avd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b3fZyR71--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0wq2usvmz6t1lm35avd.png" alt="Logo image cut in half" width="557" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even when you have set the height and width of a html image manually and inline , outlook still seems to have issues displaying the image correctly depending on what you emails markup may look like.&lt;/p&gt;

&lt;p&gt;You may have to deal with WYSIWYG editors that are auto generating the email and they can also face errors that come out of no where.&lt;/p&gt;

&lt;p&gt;Putting, inline “display: block; line-height: 1;” like so can force outlook to display the image correct.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"display: block; line-height: 1;"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may have to experiment with different inline styles depending on your email. Like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"156"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"42"&lt;/span&gt; &lt;span class="na"&gt;align=&lt;/span&gt;&lt;span class="s"&gt;"right"&lt;/span&gt; &lt;span class="na"&gt;valign=&lt;/span&gt;&lt;span class="s"&gt;"bottom"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"line-height: 1;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"156"&lt;/span&gt; &lt;span class="na"&gt;border=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;cellspacing=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;cellpadding=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"line-height: 1;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.example.com/"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"display: block; line-height: 1;"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"display: block; line-height: 1;"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.example.com/emarketing/logo.jpg"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"196"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"42"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Bc7Tlzp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8cqi36joss122b7zx7z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Bc7Tlzp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8cqi36joss122b7zx7z2.png" alt="Image of the fixed logo" width="554" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reason for this is due to Outlook not respecting the height attribute if line-height is not set to at least 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/a/21603951"&gt;https://stackoverflow.com/a/21603951&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.campaignmonitor.com/css/"&gt;https://www.campaignmonitor.com/css/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to undo git commits? Locally &amp; Remotely.</title>
      <dc:creator>John J Davidson</dc:creator>
      <pubDate>Sun, 26 Jun 2022 20:38:00 +0000</pubDate>
      <link>https://dev.to/xuz99/how-to-undo-commits-locally-remotely-304</link>
      <guid>https://dev.to/xuz99/how-to-undo-commits-locally-remotely-304</guid>
      <description>&lt;p&gt;TL:DR ⏩&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the repo, open a new terminal window &lt;/li&gt;
&lt;li&gt;Enter this command: 
&lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Find the commit hash you want to revert the repo to.&lt;/li&gt;
&lt;li&gt;Enter this command: 
&lt;code&gt;git reset --hard theHashOfTheCommitHere&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example: &lt;code&gt;git reset --hard 0ffbffgs3&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Then enter: 
&lt;code&gt;git clean -f -d&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Finely you need to force push the reset repo to the remote with this command: 
&lt;code&gt;git push -f&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To exit git at any time you and type &lt;code&gt;q&lt;/code&gt; next to the colon at the bottom of your CLI.&lt;/p&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git reset --hard xxxxx&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git clean -f -d&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git push -f&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;Long version. ⬇️&lt;/p&gt;

&lt;p&gt;At some point, you'll be commit something to a repo that you look back and wish you didn't commit that feature/bug fix/OnlyFans video.&lt;/p&gt;

&lt;p&gt;So when that happens and you have even pushed the commit to remote, what should you do?&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you undo git commits?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Locally &amp;amp; remotely.
&lt;/h2&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Step #1: &lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;You need to explore your git repo and the status of it. This is so we can find the hash number for the commit you want to revert back too. &lt;/p&gt;

&lt;p&gt;You need to open the repo in your terminal/command line interface (CLI) inside of your working repo directory and &lt;strong&gt;in the branch you want to reset the commit on&lt;/strong&gt;. You can enter this command:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This will output/display this in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ICya2i15--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh7qz1tqb37woawcnekv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ICya2i15--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh7qz1tqb37woawcnekv.png" alt="git log in oneline, decorate, graph" width="656" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's break this command down to better understand it.&lt;/p&gt;

&lt;p&gt;To exit git at any time you can type &lt;code&gt;q&lt;/code&gt; next to the colon at the bottom of your CLI.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
⭕ &lt;br&gt;
If you don't need to know the break down of the command, go to:  &lt;br&gt;
 &lt;strong&gt;Step #2: &lt;code&gt;git reset --hard xxxxx&lt;/code&gt;&lt;/strong&gt; &lt;br&gt;
⭕&lt;br&gt;
 &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;git log&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This part simply gives you a record or log of all the commits you have created in this repo. However unlike the above screen shot which lists them all on one line.&lt;/p&gt;

&lt;p&gt;This gives you very detailed description of your git commits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---8RqEOn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc19uydoel52at8tkvu3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---8RqEOn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc19uydoel52at8tkvu3.png" alt="Detailed description of your git commits" width="611" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;git log --oneline&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This is the &lt;strong&gt;first flag&lt;/strong&gt; in the command and is used to format the output of the log. if you do not use this the output log would look like this:&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;--oneline&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---8RqEOn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc19uydoel52at8tkvu3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---8RqEOn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc19uydoel52at8tkvu3.png" alt="Detailed description of your git commits" width="611" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;--oneline&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jDk4ivlh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m829c4aeehjstu49v5ab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jDk4ivlh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m829c4aeehjstu49v5ab.png" alt="git log in oneline" width="661" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Git Documentation says:&lt;br&gt;
&lt;a href="https://www.git-scm.com/docs/git-log#Documentation/git-log.txt---oneline"&gt;This is a shorthand for "--pretty=oneline --abbrev-commit" used together.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;git log --oneline --decorate&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The second flag in the command is another formatting flag, that will highlight what &lt;a href="https://git-scm.com/book/en/v2/Git-Internals-Git-References"&gt;Git Reference&lt;/a&gt; you are on and there are some options you can added to the end of &lt;code&gt;--decorate&lt;/code&gt; such as &lt;code&gt;--decorate[=short|full|auto|no]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Git references are bit out of the scope for this tutorial, however if you are aware of them, you may find this part a useful flag.&lt;/p&gt;

&lt;p&gt;Here is a small demo of the command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --oneline --decorate=short&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VI-8DUop--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrilrrb3hexc6ia1fh67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VI-8DUop--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrilrrb3hexc6ia1fh67.png" alt="Output of git log --oneline --decorate=short" width="518" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --oneline --decorate=full&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zfXljxi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3r16vel52vh4thu5lqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zfXljxi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3r16vel52vh4thu5lqc.png" alt="Output of git log --oneline --decorate=full" width="715" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-scm.com/docs/git-log#Documentation/git-log.txt---decorateshortfullautono"&gt;--decorate[=short|full|auto|no]&lt;br&gt;
Print out the ref names of any commits that are shown.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;--graph&lt;/code&gt; is the third and last flag in the command. It is a non essential flag, but will allow for a bit of a nice formatting so you can visualize your git log better.&lt;/p&gt;

&lt;p&gt;Specifically it will deal with commits you have merged from other branches and show that merge in a graphical text based visualization.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;--graph&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---2CJYQ66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/saoxod41ic1tpzf32wdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---2CJYQ66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/saoxod41ic1tpzf32wdf.png" alt="Output of git log --oneline --decorate" width="799" height="991"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;--graph&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lrAw_dcG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63jeh8ohyjliy35e5wkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lrAw_dcG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63jeh8ohyjliy35e5wkn.png" alt="Output of git log --oneline --decorate --graph" width="814" height="933"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that is what, &lt;code&gt;git log --oneline --decorate --graph&lt;/code&gt; does.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;h3&gt;
  
  
  Step #2: &lt;code&gt;git reset --hard xxxxx&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;Now you have the commit hash you need and now it is time to reset your working git branch to the commit you want to revert back too.&lt;/p&gt;

&lt;p&gt;To do this, you need to do use the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git reset --hard xxxxx&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;--hard&lt;br&gt;
Resets the index and working tree. Any changes to tracked files in the working tree since  are discarded. Any untracked files or directories in the way of writing any tracked files are simply deleted. &lt;a href="https://www.git-scm.com/docs/git-reset#Documentation/git-reset.txt---hard"&gt;Source: git-reset Documentation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What does that mean? Well you have to compare this command to: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git reset --soft xxxxx&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;Let's look at the CLI/terminal in VScode in a working repo and compare the two.  &lt;/p&gt;

&lt;p&gt;With: &lt;code&gt;git reset --soft xxxxx&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i1HPp-SW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22ae9ntl2d35xiz5sqts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i1HPp-SW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22ae9ntl2d35xiz5sqts.png" alt="Using git reset --soft " width="880" height="754"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using &lt;code&gt;--soft&lt;/code&gt; as a mode you will reset the working directory to the requested commit, however all the changes in the commits after the requested commit will undo, and become staged changes in the repo. As seen above.&lt;/p&gt;

&lt;p&gt;With: &lt;code&gt;git reset --hard xxxxx&lt;/code&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e7Rq2QyQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3qk4ku1ve4ne0siojyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e7Rq2QyQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3qk4ku1ve4ne0siojyx.png" alt="Using git reset --hard" width="880" height="869"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The working directory is now completely clear of all commits after the reset to the requested commit, and there is no staged changes, the commits are gone. This is irreversible. &lt;/p&gt;

&lt;p&gt; &lt;br&gt;
&lt;strong&gt;Well kind of irreversible...&lt;/strong&gt;&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;If you notice at the bottom of the above screenshot you'll see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sz1vpler--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lzzx4ajxyyryro4fwsl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sz1vpler--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lzzx4ajxyyryro4fwsl2.png" alt="A screen shot of a pull from orign" width="478" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I still have one commit to pull from remote. As you guessed it. It is the one I just reset. At this point your local working directory has been reset, and if that is all you need to do. Then you have finished. But...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OXf3MLVe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efjplxa418wtvjmnrhl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OXf3MLVe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/efjplxa418wtvjmnrhl5.png" alt="the reset commit added back to repo" width="473" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...how do you reset a commit when you have already pushed it remotely? &lt;/p&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Step #3: &lt;code&gt;git clean -f -d&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;Step back and make sure you have used the command: &lt;br&gt;
&lt;code&gt;git reset --hard xxxxx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that you can safely move on to the git clean.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-scm.com/docs/git-clean"&gt;https://www.git-scm.com/docs/git-clean&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-d&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Normally, when no  is specified, git clean will not recurse into untracked directories to avoid removing too much. Specify -d to have it recurse into such directories as well. If any paths are specified, -d is irrelevant; all untracked files matching the specified paths (with exceptions for nested git directories mentioned under --force) will be removed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;-f&lt;br&gt;
--force&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or directories unless given -f or -i. Git will refuse to modify untracked nested git repositories (directories with a .git subdirectory) unless a second -f is given.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These two descriptions of the &lt;code&gt;-d&lt;/code&gt; &amp;amp; &lt;code&gt;-f&lt;/code&gt; flag are quite indepth. But to help with a jist what they are doing along with &lt;code&gt;git clean&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;They will first tell git to clean the working directory of any and all untracked files, using the flag &lt;code&gt;-d&lt;/code&gt; will say that you have not specified a path and &lt;code&gt;-f&lt;/code&gt; will tell git "just do it, don't warn me" because once done this can not be un done. &lt;/p&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Step #4: &lt;code&gt;git push -f&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt; &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.git-scm.com/docs/git-push#Documentation/git-push.txt---force"&gt;--force&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;...This flag disables these checks, and can cause the remote repository to lose commits; &lt;strong&gt;use it with care.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The above description covers the &lt;code&gt;git push -f&lt;/code&gt; quite well, however it warns us that we should use this command with care and we should, but this is the part where we want git to overwrite the existing commit on the remote repo. &lt;strong&gt;We want to undo a commit remotely.&lt;/strong&gt; but to use this command is the final step. once done the commit is undone and you no longer need to do or change anything else. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -f&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You have now undone a commit remotely. &lt;/p&gt;

&lt;p&gt;🥳 Congratulations! 🥳&lt;/p&gt;

&lt;p&gt;Any questions or queries. Please let me know in the comments. &lt;/p&gt;

&lt;p&gt;Any feedback is appreciated as well! &lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to open any folder with Sublime Text 3 in Windows.</title>
      <dc:creator>John J Davidson</dc:creator>
      <pubDate>Sun, 20 Jun 2021 09:48:48 +0000</pubDate>
      <link>https://dev.to/xuz99/how-to-open-any-folder-with-sublime-text-3-in-windows-4370</link>
      <guid>https://dev.to/xuz99/how-to-open-any-folder-with-sublime-text-3-in-windows-4370</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;Hi, this is my first post/tutorial. I hope you enjoy it and find it useful. In this tutorial I will be adding Sublime Text 3 to your right click menu (Context menu), so you can open files/folders in Sublime Text 3, just like you would with VScode.&lt;/p&gt;

&lt;p&gt;In this tutorial I am using Windows 10, but you should be able to achieve the same result in Windows 8/8.1 and 7.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WIN+R&lt;/strong&gt; keyboard shortcut.&lt;/li&gt;
&lt;li&gt;run &lt;strong&gt;"regedit.exe"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;copy pasting into the address bar at the top:&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;HKEY_CLASSES_ROOT\Directory\Background&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Inside the &lt;code&gt;shell&lt;/code&gt; folder, create a new key and call it: "Open with Sublime Text 3" (or whatever you'd like to call it)&lt;/li&gt;
&lt;li&gt;Make another new key inside of this and call it: "command"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modify&lt;/strong&gt; the key to edit the data value of this new key.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Put the path for your computers version of Sublime Text 3. For me it is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C:\Program Files\Sublime Text\sublime_text.exe .&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Make sure to have a full stop at the end. The full stop as a flag tells windows to open &lt;em&gt;this&lt;/em&gt; folder/directory in Sublime Text 3.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Test it in any folder you like.&lt;/li&gt;
&lt;li&gt;Done. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;P.S &lt;em&gt;A more detailed version of this TL;DR with images can be seen at Step 5.&lt;/em&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 1:
&lt;/h2&gt;

&lt;p&gt;In order to edit or add a new item to your right click menu. &lt;br&gt;
You will need edit the Windows Registry to change a setting/registry key for your Windows operating system.&lt;/p&gt;

&lt;p&gt;So begin by going to the bottom left of your taskbar and click:&lt;br&gt;
&lt;strong&gt;"Start"&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RxLYYleL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3nmdlzy05wm1skkp3wqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RxLYYleL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3nmdlzy05wm1skkp3wqz.png" alt="Start Icon on the bottom left of your Windows taskbar "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 2:
&lt;/h2&gt;

&lt;p&gt;You will need to open/start the Windows &lt;strong&gt;"run.exe"&lt;/strong&gt; and search for the &lt;strong&gt;"regedit.exe"&lt;/strong&gt; in the input field. Once you type that in click &lt;strong&gt;"Ok"&lt;/strong&gt;. You can also use &lt;strong&gt;WIN+R&lt;/strong&gt; keyboard shortcut to access &lt;strong&gt;"run.exe"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AsFZF5CS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8uliw9rnvgtmv2urbd3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AsFZF5CS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8uliw9rnvgtmv2urbd3.gif" alt="Animate gif of finding and running the Windows run.exe"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 3:
&lt;/h2&gt;

&lt;p&gt;Once you run &lt;strong&gt;"regedit.exe"&lt;/strong&gt; you will have a new window appear in front of you. This is called the &lt;strong&gt;Registry Editor&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️&lt;strong&gt;WARNING&lt;/strong&gt;⚠️ Editing the Windows Registry &lt;strong&gt;&lt;em&gt;incorrectly&lt;/em&gt;&lt;/strong&gt; could do damage to your computer's operating system. So &lt;em&gt;please&lt;/em&gt; take care from this point forward, and make a &lt;strong&gt;back up&lt;/strong&gt; in case something goes wrong. Thankfully to make a back up is fairly easy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;File &amp;gt; Export &amp;gt; and save the file with what ever name you'd like.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dNfNi72b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gdwgn80jbetzbcrjybrj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dNfNi72b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gdwgn80jbetzbcrjybrj.gif" alt="Making a back of the Windows Registry"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 4:
&lt;/h2&gt;

&lt;p&gt;Now with your fancy new backup, you can edit your registry with glee. &lt;/p&gt;

&lt;p&gt;You now need to navigate to/look for a folder called:&lt;br&gt;
&lt;code&gt;HKEY_CLASSES_ROOT\*\shell\&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This should be at the very top of your Registry Editor window.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tNNJsvhJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/doopy2o1c82b0wrt2ztu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tNNJsvhJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/doopy2o1c82b0wrt2ztu.png" alt="Image pointing to HKEY_CLASSES_ROOT folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5OQz8XLt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rm2is86vgte34a9tac70.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5OQz8XLt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rm2is86vgte34a9tac70.png" alt="Image pointing to * folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zoJQH1W6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4552my408aq8rla6orf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zoJQH1W6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4552my408aq8rla6orf.png" alt="Image pointing to shell folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you will see a list of different folders. These should be different for you, depending on what you have installed on your computer.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ui5K1CY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ncrn7t3ikx0643esy84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ui5K1CY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ncrn7t3ikx0643esy84.png" alt="Image highlighting the shell folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have Sublime Text 3 installed, there should be a folder already here for you to see. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tDL8EnYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1jlirnl91lwkjnopspi6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tDL8EnYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1jlirnl91lwkjnopspi6.png" alt='Image pointing to the "Open with Sublime Text 3" folder'&gt;&lt;/a&gt;&lt;br&gt;
To see what this does, look for a file on your computer and right click on it you should see something like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VIbW8Laq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9x692qhltjp9gdju40if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VIbW8Laq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9x692qhltjp9gdju40if.png" alt="Open with Sublime Text 3 on a file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a test you can edit this file/registry key to change the name and see the change on your right click menu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WDIy4WIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p8xy8x65vthdtj1497np.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WDIy4WIc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p8xy8x65vthdtj1497np.png" alt="Rename of Sublime Text 3 registry key"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rdJqeY8n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdn7fg6nh7d10063ge5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rdJqeY8n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdn7fg6nh7d10063ge5j.png" alt="Rename of Sublime Text 3 registry key to dev.to"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--loQDLTxQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1q27ye03f7k3mawbuq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--loQDLTxQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1q27ye03f7k3mawbuq1.png" alt="Open with dev.to"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you might be asking yourself.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"That's great John, but why should I bother editing something that is already installed by Sublime Text 3?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am glad you asked that. Because yes it would seem pointless to edit something for your benefit that is already there. But there is a limit to this "Open with Sublime Text 3" option, that I hope to resolve.&lt;/p&gt;

&lt;p&gt;You &lt;strong&gt;cannot&lt;/strong&gt; open a folder of your choice with Sublime Text 3.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0617MGeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvwn49mwxf3unnwsnh9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0617MGeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvwn49mwxf3unnwsnh9j.png" alt="Right click menu not showing Open with Sublime Text 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This isn't provided to you by default or on install. And there was many times I wanted that option. So why not add it now?&lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 5:
&lt;/h2&gt;

&lt;p&gt;In your Registry Editor lets navigate to a folder called:&lt;br&gt;
&lt;code&gt;HKEY_CLASSES_ROOT\Directory\Background&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0_F-nMPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qo41rntbdm23nbaku9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0_F-nMPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qo41rntbdm23nbaku9h.png" alt="Navigating to Directory folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may notice it's with a a lot of other folders so for speed I recommend typing/copy pasting into the address bar at the top:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HKEY_CLASSES_ROOT\Directory\Background&lt;/code&gt; and it should take you right there.&lt;/p&gt;

&lt;p&gt;You should now see a &lt;code&gt;shell&lt;/code&gt; folder. Lets add a new key to it.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mUUm1y5F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qbz1n5f8uvttvmknjbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mUUm1y5F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qbz1n5f8uvttvmknjbg.png" alt="New key in Background/shell folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Call it: "Open with Sublime Text 3" (or whatever you'd like to call it)&lt;/p&gt;

&lt;p&gt;Now make another new key inside of this and call it: "command"&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DQYQZYp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr16y6l3s0if9zld8bn9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DQYQZYp1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr16y6l3s0if9zld8bn9.png" alt="New key and called command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now double click &lt;strong&gt;(Default)&lt;/strong&gt; or right click &lt;strong&gt;Modify&lt;/strong&gt; to edit the data value of this new key.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CyebsGsx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96hwqyixfc2dxrab1916.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CyebsGsx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96hwqyixfc2dxrab1916.png" alt="Editing the value for (Default)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you need to add the system path for your computers version of Sublime Text 3. For me it is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C:\Program Files\Sublime Text\sublime_text.exe&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Your installation might be different. &lt;/p&gt;

&lt;p&gt;When you have the path you need to add it to the value like so:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NwDYX72Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyrfgy5m1d3440m3arlv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NwDYX72Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyrfgy5m1d3440m3arlv.png" alt="Path to sublime_text.exe"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And one very important thing to add at the end of:&lt;br&gt;
&lt;code&gt;C:\Program Files\Sublime Text\sublime_text.exe&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;is a full stop &lt;code&gt;.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q5mC9eKO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ywtrxku210t4kxxdb8n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q5mC9eKO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ywtrxku210t4kxxdb8n.png" alt="Path to sublime_text.exe with full stop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know my screen shot above isn't very clear but adding the full stop as a flag tells windows to open &lt;em&gt;this&lt;/em&gt; folder/directory in Sublime Text 3.&lt;/p&gt;

&lt;p&gt;This is the full path: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;C:\Program Files\Sublime Text\sublime_text.exe .&lt;/code&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Step - 6:
&lt;/h2&gt;

&lt;p&gt;Now find any folder you wish and right click inside of it to test it out.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VBObxpz7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsyw0isveoo7nfn62uxb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VBObxpz7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsyw0isveoo7nfn62uxb.gif" alt="Testing out new open with Sublime Text 3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Done 🎉
&lt;/h2&gt;

&lt;p&gt;And this is as far as you need to go, you can now open Sublime Text 3 (or any program you want really) with the right click context menu. Congratulations!&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional extras 🌟
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding an Icon:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Right click on the key you created, not command. Just "Open with Sublime Text 3". &lt;strong&gt;New &amp;gt; String value&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GiopH7Z8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3nvksap9o3ocz4pxdlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GiopH7Z8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3nvksap9o3ocz4pxdlr.png" alt="Adding an icon string value"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Call it: Icon&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set it to the same value as the path you set above in Step 5.&lt;br&gt;
&lt;code&gt;"C:\Program Files\Sublime Text\sublime_text.exe"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes with the &lt;strong&gt;" "&lt;/strong&gt; around the path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ujqyVJnl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20036h8wc7bssaw9dqp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ujqyVJnl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20036h8wc7bssaw9dqp6.png" alt="Setting the string value"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jPQOYDpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh6s3bmyg8xjuxiur9db.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jPQOYDpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh6s3bmyg8xjuxiur9db.png" alt="Open with Sublime Text 3 in Icon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom position in context menu:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Right click on the key you created, not command. Just "Open with Sublime Text 3". &lt;strong&gt;New &amp;gt; String value&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RtHOFAKH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpopidonzjbr1mdbcv6t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RtHOFAKH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpopidonzjbr1mdbcv6t.png" alt="Adding a Position string value"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Call it: &lt;code&gt;Position&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set it to the value to:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Top&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A0Tk30Ol--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/et7odmf0zuetn1qhs5jr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A0Tk30Ol--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/et7odmf0zuetn1qhs5jr.png" alt="Top position of new context menu item"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you want the position to be at the bottom. Set the value to:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;Bottom&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XL2Y8wW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/74pp4xxf3s1jqrx2oxsf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XL2Y8wW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/74pp4xxf3s1jqrx2oxsf.png" alt="Bottom position of new context menu item"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;This post came from my own desire to add Sublime Text 3 to the Windows context menu and open it in any folder I wanted. What I thought would be a simple thing turned out to be fairly difficult for me and a lot of DuckDuckGo later, I am here. This post is my documentation of the process so it's available for me in the future and I hope it is helpful to you. Dear reader. :D  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  With thanks:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To this fantastic &lt;a href="https://stackoverflow.com/questions/3681032/set-icon-for-custom-right-click-context-menu-item-for-all-desktop-shortcuts-win"&gt;stackoverflow&lt;/a&gt; question and discussion giving me a lot of help and guidance on how to add an icon to my new context menu item.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To this &lt;a href="https://www.techspot.com/guides/1670-windows-right-click-menu/"&gt;Techspot&lt;/a&gt; article going a bit more in depth with images and pointing myself the right direction to really flesh things out. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To this &lt;a href="https://www.lifewire.com/what-is-a-registry-key-2625999"&gt;Livewire&lt;/a&gt; article. Going deep on what a registry key and how to edit them.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Jargon explainer:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 7/8/10:  Windows is the operating system that is being used in this tutorial, (7/8/10) is the version of the operating system &lt;a href="https://en.wikipedia.org/wiki/Microsoft_Windows"&gt;link to Wikipedia article&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iLMbRnJi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ytimg.com/vi/OIak121q5tw/maxresdefault.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iLMbRnJi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ytimg.com/vi/OIak121q5tw/maxresdefault.jpg" alt="Screenshot of windows" title="Screenshot of windows"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Context menu: A small box/menu that appears when you right click anywhere in a Windows operating system.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wryurm6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/en/thumb/5/50/Context_menu_windows.png/233px-Context_menu_windows.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wryurm6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/en/thumb/5/50/Context_menu_windows.png/233px-Context_menu_windows.png" alt="Context menu" title="Context menu"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows Registry: The registry in windows is the place that store all of your windows computer software settings. stuff like: hardware devices, user preferences, and operating-system configurations. &lt;a href="https://www.lifewire.com/windows-registry-2625992"&gt;link to detailed explainion&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hujRAvSV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lifewire.com/thmb/axTOzZb0hVO9ZZFJ2n7WWeq6C_Y%3D/1002x0/filters:no_upscale%28%29:max_bytes%28150000%29:strip_icc%28%29:format%28webp%29/registry-hives-windows-10-5a466683beba330037a4057a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hujRAvSV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.lifewire.com/thmb/axTOzZb0hVO9ZZFJ2n7WWeq6C_Y%3D/1002x0/filters:no_upscale%28%29:max_bytes%28150000%29:strip_icc%28%29:format%28webp%29/registry-hives-windows-10-5a466683beba330037a4057a.PNG" alt="Windows registry" title="Windows registry"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HKEY_CLASSES_ROOT is the global &lt;a href="https://www.lifewire.com/hkey-classes-root-2625899"&gt;"hive"&lt;/a&gt;/folder that holds the all the information that effects all users on that computer. Similar to a global variable/root directory that you can edit. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.lifewire.com/what-are-environment-variables-2625868"&gt;Environment variables&lt;/a&gt; are surrounded by the percent sign (%), as in %temp%, to distinguish them from regular text. You can reference user variables and system variables as we did in the "Opening the folder with custom file name/date:"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>windows</category>
      <category>registry</category>
    </item>
  </channel>
</rss>
