<?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: Rina</title>
    <description>The latest articles on DEV Community by Rina (@rinamikami2).</description>
    <link>https://dev.to/rinamikami2</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%2F1367064%2F39c318d3-9fcf-47bd-a724-1f95615218ae.png</url>
      <title>DEV Community: Rina</title>
      <link>https://dev.to/rinamikami2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rinamikami2"/>
    <language>en</language>
    <item>
      <title>Top 10 Git Commands I Use Every Day</title>
      <dc:creator>Rina</dc:creator>
      <pubDate>Wed, 20 Mar 2024 00:54:31 +0000</pubDate>
      <link>https://dev.to/rinamikami2/top-10-git-commands-i-use-every-day-2n46</link>
      <guid>https://dev.to/rinamikami2/top-10-git-commands-i-use-every-day-2n46</guid>
      <description>&lt;p&gt;Over the years, I've found myself relying on a core set of Git commands on a daily basis. These commands help me manage code changes, synchronize with team members, and maintain a clean project history.&lt;/p&gt;

&lt;p&gt;Here's a rundown of the top 10 Git commands that are indispensable in my daily workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;code&gt;git clone&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Before you can work on a project, you need to get it onto your local machine. The &lt;code&gt;git clone&lt;/code&gt; command does just that by copying an existing Git repository from a remote location to your local machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. &lt;code&gt;git status&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Once you've started making changes, it's crucial to keep track of your work. The &lt;code&gt;git status&lt;/code&gt; command provides a summary of which files have been modified, which are staged for commit, and which are not being tracked by Git.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. &lt;code&gt;git add&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When you're ready to save changes in Git, you first need to stage them using the &lt;code&gt;git add&lt;/code&gt; command. This command updates the index with the current content found in the working tree, to prepare the content staged for the next commit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;file-or-directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. &lt;code&gt;git commit&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Committing is like taking a snapshot of your project's currently staged changes. The &lt;code&gt;git commit&lt;/code&gt; command captures your changes in a new commit along with a log message from the user describing those changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Your commit message here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. &lt;code&gt;git push&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;After committing your changes locally, you'll want to share them with your team or update the remote repository. The &lt;code&gt;git push&lt;/code&gt; command uploads your commits to the remote repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. &lt;code&gt;git pull&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To synchronize your local repository with the remote, use the &lt;code&gt;git pull&lt;/code&gt; command. It fetches and merges changes on the remote server to your working directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. &lt;code&gt;git branch&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Working on a new feature or fix? The &lt;code&gt;git branch&lt;/code&gt; command helps you manage your branches and ensures that you're working in the right context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. &lt;code&gt;git checkout&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Switching between branches is a common task. The &lt;code&gt;git checkout&lt;/code&gt; command lets you navigate to different branches in your repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. &lt;code&gt;git merge&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Once your feature or fix is ready, you'll need to merge your branch back into the main branch. The &lt;code&gt;git merge&lt;/code&gt; command combines the history of the specified branch into your current branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  10. &lt;code&gt;git log&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To view the commit history of your project, the &lt;code&gt;git log&lt;/code&gt; command is invaluable. It shows the chronological commit history for the current branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Incorporating these commands into your daily workflow can significantly improve your productivity and collaboration efforts on any Git-based project.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Besides all the commands above, I will check [dev resources](https://cheatsheet.md) in case I forget something.

Hope this tip helps!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
