<?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: Ahmed Ghoneim</title>
    <description>The latest articles on DEV Community by Ahmed Ghoneim (@ghoneim).</description>
    <link>https://dev.to/ghoneim</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%2F805563%2F391d1124-cc77-4ddc-9d81-04223de43d29.jpeg</url>
      <title>DEV Community: Ahmed Ghoneim</title>
      <link>https://dev.to/ghoneim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ghoneim"/>
    <language>en</language>
    <item>
      <title>Git Starter Pack</title>
      <dc:creator>Ahmed Ghoneim</dc:creator>
      <pubDate>Wed, 23 Mar 2022 12:00:40 +0000</pubDate>
      <link>https://dev.to/ghoneim/git-starter-pack-2f5a</link>
      <guid>https://dev.to/ghoneim/git-starter-pack-2f5a</guid>
      <description>&lt;p&gt;We've all probably used git in our companies. Usually we're taught a few basics and then left alone to deal with the monster that is git. Soon we start to have to handle conflicts! This article will help you learn a few tips and tricks to guide you through your development process.&lt;/p&gt;

&lt;h3&gt;
  
  
  I've changed a file and want it back
&lt;/h3&gt;

&lt;p&gt;There are two situations here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I want it back to the last commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git checkout &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I committed it but I want it back to master&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git reset master &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This also works for files you've deleted!&lt;/p&gt;

&lt;h3&gt;
  
  
  I made a mistake while merging
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git merge --abort&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to select one commit from another branch
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git cherry-pick &amp;lt;commit-hash&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to remove any files I've changed
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git checkout .&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to remove any new files I've created
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git clean -df&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to look at a certain commit
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git checkout &amp;lt;commit-hash&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to see the commit history
&lt;/h3&gt;

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

&lt;h2&gt;
  
  
  A couple of conventions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How to write commit messages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use capitalized messages:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add feature blabla&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use verbs in infinitive:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;del&gt;Added&lt;/del&gt; Add foobar&lt;/p&gt;

&lt;h3&gt;
  
  
  How to name branches
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use lower-case, url-friendly names&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;del&gt;AbCd&lt;/del&gt; abcd&lt;/p&gt;

&lt;p&gt;&lt;del&gt;a_b&lt;/del&gt; a-b&lt;/p&gt;

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