<?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: Rajeev Bera</title>
    <description>The latest articles on DEV Community by Rajeev Bera (@rajeevbera).</description>
    <link>https://dev.to/rajeevbera</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%2F409145%2Fb57a9798-839e-4e15-ac65-b3722dd442ad.png</url>
      <title>DEV Community: Rajeev Bera</title>
      <link>https://dev.to/rajeevbera</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajeevbera"/>
    <language>en</language>
    <item>
      <title>Top 35 Git Commands with Examples (and a Bonus)</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Tue, 11 May 2021 06:33:37 +0000</pubDate>
      <link>https://dev.to/rajeevbera/top-35-git-commands-with-examples-and-a-bonus-232i</link>
      <guid>https://dev.to/rajeevbera/top-35-git-commands-with-examples-and-a-bonus-232i</guid>
      <description>&lt;p&gt;If you are a new or experienced developer, you have to use source control. And good chances are you are using Git to manage your source code.&lt;/p&gt;

&lt;p&gt;And to use Git to its full potential, you need to know Git commands. Here you will learn the most helpful Git commands that will take you from one level to another.&lt;/p&gt;

&lt;p&gt;To make this Git commands guide more helpful, I have divided the guide into three different sections: &lt;strong&gt;Basic, Intermediate, and Advanced Git commands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is an epic guide. And to make it more useful, I have added a &lt;strong&gt;Bonus section&lt;/strong&gt; where you can &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;&lt;strong&gt;download 51+ Git commands&lt;/strong&gt;&lt;/a&gt; and a few more downloads to boost your productivity in Git.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download PDF section
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;51+ Best Git Commands&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-head/" rel="noopener noreferrer"&gt;Git HEAD: The Definitive Guide&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-best-practices" rel="noopener noreferrer"&gt;Git best practices&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Git Commands
&lt;/h2&gt;

&lt;p&gt;In this section, you will learn the essential Git commands. These basic Git commands are the foundation to learn more advanced commands.&lt;/p&gt;

&lt;p&gt;Here are the nine useful Git commands  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. git config
&lt;/h3&gt;

&lt;p&gt;Git config command is super helpful. Especially when you are using Git for the first time, or you have a new Git installation. This command will set up your identity — Name and Email address. And this information will be used with every commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git config — global user.name “Your name”&lt;br&gt;
$ git config — global user.email “Your email”&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  2. git version
&lt;/h3&gt;

&lt;p&gt;As its name implies, it’s just to check which version of Git you are using. At the moment, writing this guide, the latest version of Git for Windows is 2.31.1. It was released on 27th March 2021.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git version&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  3. git init
&lt;/h3&gt;

&lt;p&gt;This is probably the first command you use to start a new project in Git. This command will create a blank new repository, and then you can store your source code inside this repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git init&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Or you can use the repository name with your git init command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git init [your repository name]&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  4. git clone
&lt;/h3&gt;

&lt;p&gt;The git clone command will use an existing repository to copy. There is one main difference between the git init and git clone. You will use the Git clone when you need to make a copy on an existing repository. &lt;/p&gt;

&lt;p&gt;The git clone command internally uses the git init command first and then checks out all its contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git clone [your project url]&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  5. git add
&lt;/h3&gt;

&lt;p&gt;The Git add command will add all the new code files or modified files into your repository. This command offers different options to add files and folders. &lt;/p&gt;

&lt;p&gt;Here is the usage of the Git add command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git add your-file-name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(it will add single file to your the staging area)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git add *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;( this option will add all the modified and new files to the staging area)  &lt;/p&gt;

&lt;h3&gt;
  
  
  6. git commit
&lt;/h3&gt;

&lt;p&gt;This Git command is essential. Your project quality may drop if you will not use this command appropriately. &lt;/p&gt;

&lt;p&gt;There is another article about how to use Git commands property, and you can read that here.&lt;/p&gt;

&lt;p&gt;In simple words, git commit will add your changes to your local repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git commit -m “your useful commit message”&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  7. git status
&lt;/h3&gt;

&lt;p&gt;This Git command is convenient to see how many files are there which need your attention. &lt;/p&gt;

&lt;p&gt;You can run this command at any time. You can use it in between Git add, and Git commits to see the status.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git status&lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  8. git branch
&lt;/h3&gt;

&lt;p&gt;Most of the time, you have multiple branches in your Git repository. In simple terms, the branch is an independent line of code development.&lt;/p&gt;

&lt;p&gt;With the Git branch command, you can manage your branches effectively. There are many different options and switches of the Git branch.&lt;/p&gt;

&lt;p&gt;To make it simple, here I will highlight how you can create and delete a Git branch. And, in case you need more depth, you can refer to — &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;Git Branching &amp;amp; Merging section of this article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(i) To list all branches&lt;br&gt;
&lt;em&gt;$ git branch&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(ii) To create a new branch&lt;br&gt;
&lt;em&gt;$ git branch &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(iii) To delete a branch&lt;br&gt;
&lt;em&gt;$ git branch -d &lt;/em&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  9. git checkout
&lt;/h3&gt;

&lt;p&gt;This Git command is used to switch between branches. This is one of the powerful git commands and can use used as a swiss knife,&lt;/p&gt;

&lt;p&gt;In simple words, here is the syntax to switch to another branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git checkout &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Also, you can create and checkout to a branch in a single like, here is the usage for that&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git checkout -b &lt;/em&gt;    &lt;/p&gt;

&lt;h2&gt;
  
  
  Intermediate Level Git Commands
&lt;/h2&gt;

&lt;p&gt;After the basic Git commands, it’s time to share with you intermediate Git commands; these Git commands are super helpful if you need to collaborate with your team, share your code with others. &lt;/p&gt;

&lt;p&gt;Also, there are commands like Git log that will help to see the history of previous commits.    &lt;/p&gt;

&lt;h3&gt;
  
  
  10. git remote
&lt;/h3&gt;

&lt;p&gt;Git remote command acts like a border, and If you need to connect with the outside world, you have to use the Git remote command. This command will connect your local repository to the remote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git remote add  &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git remote add origin &lt;a href="https://dev.azure.com/aCompiler/_git/DemoProject" rel="noopener noreferrer"&gt;https://dev.azure.com/aCompiler/_git/DemoProject&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  11. git push
&lt;/h3&gt;

&lt;p&gt;Once you are connected with the remote repository (with the help of the git remote command), it’s time to push your changes to that repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git push -u  &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git push -u origin feature-branch&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You should have origin and upstream set up before you use Git push. And here is the command to set up upstream.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git push — set-upstream  &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git push — set-upstream origin feature-branch&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  13. git fetch
&lt;/h3&gt;

&lt;p&gt;When you need to download other team members’ changes, you have to use git fetch. This command will download all information for commits, refs, etc., &lt;/p&gt;

&lt;p&gt;so you can review it before applying those changes in your local repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git fetch&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  14. git pull
&lt;/h3&gt;

&lt;p&gt;The Git pull command downloads the content (and not the metadata) and immediately updates your local repository with the latest content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git pull &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  15. git stash
&lt;/h3&gt;

&lt;p&gt;This Git command temporarily stores your modified files. You can work in stashed with the following Git command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git stash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And you can view all of your stashes with the following command&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git stash list&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And if you need a apply a stash to a branch, simply use apply&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git stash apply&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  16. git log
&lt;/h3&gt;

&lt;p&gt;With the help of the Git log, you can see all the previous commits with the most recent commit appear first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git log&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By default, it will show you all the commits of the currently checked out branch, but you can force it to see all the commits of all the branches with all option.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$ git log — all&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  17. git shortlog
&lt;/h3&gt;

&lt;p&gt;The shortlog command shows you a summary from the Git log command. This command is helpful if you are just interested in the short summary.&lt;/p&gt;

&lt;p&gt;This command is helpful to see who worked on what as it group author with their commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git shortlog&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  18. git show
&lt;/h3&gt;

&lt;p&gt;Compared to the Git log, this command git show will show you details about a specific commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git show &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  19. git rm
&lt;/h3&gt;

&lt;p&gt;Sometimes you need to delete files from your codebase, and in that case, you can use the Git rm command.&lt;/p&gt;

&lt;p&gt;It can delete tracked files from the index and the working directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git rm &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  20. git merge
&lt;/h3&gt;

&lt;p&gt;Git merge helps you to integrate changes from two branches into a single branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git merge &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This command will merge the  into your current selected branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Level Git Commands
&lt;/h2&gt;

&lt;p&gt;And now the time to up one more level. In this section, you will learn the advanced Git commands. These commands will take time and practice. Once you know the basics of these commands, it will be easy to use them every day.&lt;/p&gt;

&lt;h3&gt;
  
  
  21. git rebase
&lt;/h3&gt;

&lt;p&gt;Git rebase similar to the git merge command. It integrates two branches into a single branch with one exception. A git rebase command rewrites the commit history.&lt;/p&gt;

&lt;p&gt;You should use the Git rebase command when you have multiple private branches to consolidate into a single branch. And it will make the commit history linear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;$ git rebase &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  22. git bisect
&lt;/h3&gt;

&lt;p&gt;The Git bisect command helps you to find bad commits.&lt;br&gt;
&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;i) To start the git bisect&lt;br&gt;
&lt;em&gt;$ git bisect start&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ii) let git bisect know about a good commit&lt;br&gt;
&lt;em&gt;$ git bisect good a123&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;iii) And let git bisect know about a bad commit&lt;br&gt;
&lt;em&gt;$ git bisect bad z123&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With Git bisect you can narrow down the broken code within a few minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  23. git cherry-pick
&lt;/h3&gt;

&lt;p&gt;Git cherry-pick is a helpful command. It’s a robust command and allows you to pick any commit from any branch and apply it to any other branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git cherry-pick &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Git cherry-pick doesn’t modify the history of a repository; instead, it adds to the history.&lt;/p&gt;

&lt;h3&gt;
  
  
  24. git archive
&lt;/h3&gt;

&lt;p&gt;Git archive command will combine multiple files into a single file. It’s like a zip utility, so it means you can extract the archive files to get individual files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git archive — format zip HEAD &amp;gt; archive-HEAD.zip&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It will create a zip archive of the current revision.&lt;/p&gt;

&lt;h3&gt;
  
  
  25. git pull — rebase
&lt;/h3&gt;

&lt;p&gt;Most of the time, you need to do rebase (and no merge) when you use Git pull.&lt;/p&gt;

&lt;p&gt;In that case, you can use the option&lt;br&gt;
&lt;em&gt;$ git pull — rebase&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It will help you to keep the history clean. Also you can avoid multiple merges .&lt;/p&gt;

&lt;h3&gt;
  
  
  26. git blame
&lt;/h3&gt;

&lt;p&gt;If you need to examine the content of any file line by line, you need to use git blame. It helps you to determine who made the changes to a file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git blame &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  27. git tag
&lt;/h3&gt;

&lt;p&gt;In Git, tags are helpful, and you can use them to manage the release. You can think of a Git tag like a branch that will not change. It is significantly more important if you are making a public release.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git tag -a v1.0.0&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  28. git verify-commit
&lt;/h3&gt;

&lt;p&gt;The git verify-commit command will check the gpg signature. GPG or “GNU Privacy Guard” is the tool used in sign files and contains their signatures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;$ git verify-commit &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  29. git verify-tag
&lt;/h3&gt;

&lt;p&gt;In the same way you can confirm a tag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;$ git verify-tag &lt;/p&gt;

&lt;h3&gt;
  
  
  30. git diff
&lt;/h3&gt;

&lt;p&gt;Most Of the time, you need to compare two git files or branches before you commit or push. Here is a handy command to do that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;i) to compare working directory with local repo&lt;br&gt;
&lt;em&gt;$ git diff HEAD &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ii) to compare two branches&lt;br&gt;
&lt;em&gt;$ git diff  &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  31. git citool
&lt;/h3&gt;

&lt;p&gt;Git citool is a graphics alternative of the Git commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git citool&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9dd70tmw09z11drgf4xz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9dd70tmw09z11drgf4xz.png" alt="git citool" width="768" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  32. git mv
&lt;/h3&gt;

&lt;p&gt;To rename a git file. It will accept two arguments, source and target file name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git mv  &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  33. git clean
&lt;/h3&gt;

&lt;p&gt;You can deal with untracked files by using the Git clean command. You can remove all the untracked files from your working directory by using this command. &lt;/p&gt;

&lt;p&gt;In case you want to deal with tracked files you need to use the Git reset command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git clean&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  34. git help
&lt;/h3&gt;

&lt;p&gt;There are many commands in Git, and if you need more help with any command, you can use git help at any time from the terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;$ git help &lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  35. git whatchanged
&lt;/h3&gt;

&lt;p&gt;This command does the same thing as git log but in a raw form. And it’s in the git because of historical reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;br&gt;
$ git whatchanged&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Section
&lt;/h2&gt;

&lt;p&gt;As not, you know the Git commands, and it is time for the bonus section. &lt;/p&gt;

&lt;p&gt;Here I will share with you Git best practices and downloadable material so you can read in your own time.&lt;/p&gt;

&lt;p&gt;First, let’s talk about the free download that I would love to share with you,&lt;/p&gt;

&lt;h2&gt;
  
  
  Download PDF section
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;51+ Best Git Commands&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-head/" rel="noopener noreferrer"&gt;Git HEAD: The Definitive Guide&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://acompiler.com/git-best-practices" rel="noopener noreferrer"&gt;Git best practices&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Best Practices
&lt;/h3&gt;

&lt;p&gt;Here I will share in brief one of the favourite Git best practice — &lt;strong&gt;AFTER technique&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A — Atomic commits&lt;br&gt;
F — Frequent commits&lt;br&gt;
T — Test before your push&lt;br&gt;
E — Enforce standards&lt;br&gt;
R — Refactoring is not a feature&lt;/p&gt;

&lt;p&gt;I hope you enjoyed this article. These Git commands will take your skills to the next level.&lt;/p&gt;

&lt;p&gt;For such informative articles, please &lt;a href="https://acompiler.com/newsletter/" rel="noopener noreferrer"&gt;join aCompiler’s newsletter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Parallel Programming In Git</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Mon, 12 Oct 2020 05:56:20 +0000</pubDate>
      <link>https://dev.to/rajeevbera/parallel-programming-in-git-6gl</link>
      <guid>https://dev.to/rajeevbera/parallel-programming-in-git-6gl</guid>
      <description>&lt;p&gt;There are many Git Tips and Git Best Practices that can help you in your day to day activities. You will save you valuable time, and with these Git tricks, you can improve your workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this post, you will learn Parallel Programming in Git (in 2 minutes)&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;In case you want to &lt;a href="https://acompiler.com/Git-Tips/" rel="noopener noreferrer"&gt;download 31 Advanced Git tips&lt;/a&gt;, you can download in a printable &lt;a href="https://acompiler.com/Git-Tips/" rel="noopener noreferrer"&gt;pdf form here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So let's start!&lt;/p&gt;

&lt;p&gt;Imagine, You are working on a large legacy project in the Git repo. And at some hours you have to support the project and at other hours you have to add new features.&lt;/p&gt;

&lt;p&gt;And to be honest, this is quite common in many organizations.  &lt;/p&gt;

&lt;p&gt;Now you can not switch between branches all the time - it might take quite a long time to complete the switch as it is a large project. And if you do switch via your IDE, it might crash.&lt;/p&gt;

&lt;p&gt;Let me share one another example - You can in the middle of your adding a new feature, and at the same time, a new live bug reported, which is critical to fix. How yo deal with this. &lt;/p&gt;

&lt;p&gt;There are a few ways to achieve this like you can stash your changes. But in this case, one of the best ways is to work on bug fixing and adding new features without switching the branches. And yes, it is possible in Git. &lt;/p&gt;

&lt;p&gt;You can use the Worktrees to achieve parallel programming in Git.&lt;/p&gt;

&lt;p&gt;In this post, I will share 3 Worktrees Git commands so you can achieve the parallel programming.&lt;/p&gt;




&lt;h2&gt;
  
  
  Worktree
&lt;/h2&gt;

&lt;p&gt;Before that, let's see the basics of worktree. Git worktree command allows you to have multiple working directories associated with one git repo. A git repository can support multiple working trees, allowing you to check out more than one branch at a time.&lt;/p&gt;

&lt;p&gt;Now let's see three Git commands to manage worktree.&lt;/p&gt;




&lt;h2&gt;
  
  
  Worktree Terminology
&lt;/h2&gt;

&lt;p&gt;By default you have only one worktree; it is known as the Primary / Main worktree. And a newly created worktree known as Linked worktree. &lt;/p&gt;




&lt;h2&gt;
  
  
  View Your Worktrees
&lt;/h2&gt;

&lt;p&gt;Before creating a worktree, you can view how many worktree you currently have. You can use a &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;simple Git command&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git worktree list&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will display all the worktrees available in your Git repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvychhrlttydycr808b2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvychhrlttydycr808b2k.png" alt="alt text" width="560" height="82"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Add a New Worktree
&lt;/h2&gt;

&lt;p&gt;Let’s add a new worktree and see how you can use it. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git worktree add &amp;lt;your new work tree name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command will create a new worktree. You can confirm it by simply list all your worktree with the git worktree list command.&lt;/p&gt;

&lt;p&gt;Here is the screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fydn4xs9jo5of6te40wp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fydn4xs9jo5of6te40wp3.png" alt="add a work tree image" width="560" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the above screenshot, you have two worktree in the same repo.&lt;/p&gt;

&lt;p&gt;Technically at the same time, you can fix some bugs and add new features in the Git repo without checkout any other branch.&lt;/p&gt;




&lt;h2&gt;
  
  
  Delete a Worktree
&lt;/h2&gt;

&lt;p&gt;Once you are done with your new feature, You can simply delete your worktree with a simple command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git worktree remove &amp;lt;your worktree name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fg9oa21vmv39ark4t7429.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg9oa21vmv39ark4t7429.png" alt="Delete work tree image" width="557" height="94"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Git is a powerful version control system. There is no doubt that  &lt;a href="https://acompiler.com/git-best-practices/" rel="noopener noreferrer"&gt;with Git Best Practices, you can improve the git workflow&lt;/a&gt; and overall efficiency. &lt;/p&gt;

&lt;p&gt;By default, there is only one working directory with your repo. And with the help of Git worktree, you can have multiple working directories. &lt;/p&gt;

&lt;p&gt;In Linked working trees, you can not have the same branch name-checked out.  &lt;/p&gt;

&lt;p&gt;Hope with these simple commands, you can achieve parallel programming. &lt;/p&gt;

&lt;p&gt;Let me know your thoughts.&lt;/p&gt;




</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>How to DIG in Git: Best Practices</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Fri, 14 Aug 2020 12:54:24 +0000</pubDate>
      <link>https://dev.to/rajeevbera/how-to-dig-in-git-best-practices-3gjk</link>
      <guid>https://dev.to/rajeevbera/how-to-dig-in-git-best-practices-3gjk</guid>
      <description>&lt;p&gt;This is one of the easiest best practices which you can start using in less than 2 minutes. But the impact will be huge.&lt;/p&gt;

&lt;p&gt;Today I will share one of my all-time favorite practice - DIG in your GIT&lt;/p&gt;

&lt;p&gt;And I have a bonus section for you, I am sharing two downloadable pdf with 51+ important git commands with a one-line summary and &lt;a href="https://acompiler.com/git-best-practices/" rel="noopener noreferrer"&gt;35+ git best practices&lt;/a&gt; with you in this post. &lt;/p&gt;

&lt;p&gt;Don’t Ignore .gitignore (DIG) in your Git repository. I have noticed in the past many developers do not use a .gitignore file.&lt;/p&gt;

&lt;p&gt;Use the .gitignore file is one of the git best practices. And I will cover in this post how gitignore can boost your code quality with other advantages.&lt;/p&gt;

&lt;p&gt;Also, I will explain how you can use your global .gitignore file (without adding or pushing). And this comprehensive file will be used by all your repository.  &lt;/p&gt;

&lt;p&gt;So let’s dive in…&lt;/p&gt;

&lt;h1&gt;
  
  
  What is .gitignore?
&lt;/h1&gt;

&lt;p&gt;There is not any git ignore command which you can use directly to ignore the unwanted files in your repository; instead, you should use .gitignore file.&lt;/p&gt;

&lt;p&gt;In simple words, the .gitignore file is a text file that tells Git about which files to ignore.&lt;/p&gt;

&lt;p&gt;Git checks three things in your working copy. &lt;/p&gt;

&lt;p&gt;Untracked - Your changes that have not been staged or committed.&lt;/p&gt;

&lt;p&gt;Tracked - Your all changes that have been previously staged or committed.&lt;/p&gt;

&lt;p&gt;Ignored - All files which you told to Git to ignore.&lt;/p&gt;

&lt;p&gt;It's easy to create .gitignore file, create a text file, and name it .gitignore (that’s it)&lt;/p&gt;

&lt;p&gt;Remember to add a single dot . at the beginning of this file name.&lt;/p&gt;

&lt;h1&gt;
  
  
  How many types of .gitignore files?
&lt;/h1&gt;

&lt;p&gt;I have seen many developers use the local .gitignore file. They add the gitignore file in their project repository. But very few use the global file. In this section, I will explain both.&lt;/p&gt;

&lt;p&gt;Keep reading...&lt;/p&gt;

&lt;p&gt;There are two types of .gitignore files.&lt;/p&gt;

&lt;h4&gt;
  
  
  Local .gitignore file
&lt;/h4&gt;

&lt;p&gt;If you add the.gitignore file in the root of your git repository, it will be considered as a local file. It means that the .gitignore file will work on that repository.  And .gitignore file should be committed to your repository.&lt;/p&gt;

&lt;h4&gt;
  
  
  Global .gitignore file
&lt;/h4&gt;

&lt;p&gt;If you place a similar file in the root of your home directory, it will act as a global .gitignore file.&lt;/p&gt;

&lt;p&gt;What is means?&lt;/p&gt;

&lt;p&gt;This file affects every repository you use on your machine. &lt;/p&gt;

&lt;p&gt;The most significant advantage of using a global file is that you don’t need to commit it. And making one change affects all of your repositories. &lt;/p&gt;

&lt;h1&gt;
  
  
  Basic Rules for .gitignore file
&lt;/h1&gt;

&lt;p&gt;Each line in the .gitignore file specifies a pattern.  Here are some basic rules that help you to set up the .gitignore file&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Any line in the .gitignore file starts with a hash (#) is a comment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;\ character is used to escape special characters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/ figure indicates that the rule applies only to files and folders, which are located in the same folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An asterisk (*) means any number of characters (zero or more occurrence)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two asterisks (**) are used to specify any number of subdirectories&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A question mark (?) replaces zero or one character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An exclamation sign (!) indicates the inversion rules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blank lines are ignore&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can ignore entire directories paths and adding a / on end:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  What Files Should Be Ignored
&lt;/h1&gt;

&lt;p&gt;You can ignore many files which are usually auto-generated, platform-specific, and other local configuration files. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Files with sensitive information &lt;/li&gt;
&lt;li&gt;Compiled code, such as .dll or .class&lt;/li&gt;
&lt;li&gt;System files like .DS_Store or Thumbs.db&lt;/li&gt;
&lt;li&gt;Files with temporary information like a log, cache, etc.. &lt;/li&gt;
&lt;li&gt;Generated files like dist folders&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Advantages of using gitignore
&lt;/h4&gt;

&lt;p&gt;Here the top 3 advantages (that’s why I use .gitignore)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It helps you to clean your code repository by ignoring unwanted files.&lt;/li&gt;
&lt;li&gt;Your repository size stays under control, especially if you are working on a big project.&lt;/li&gt;
&lt;li&gt;Your every single commit, push, and pull request will be clean. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is no doubt that Git is powerful. But in the end, it's just another computer program.&lt;/p&gt;

&lt;p&gt;So it's a team effort to use best practices and to keep your code repo stable and make sure you use git ignore file. &lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;p&gt;Its time for the Bonus download, you can &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;download the 51 git commands from here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And &lt;a href="https://acompiler.com/git-best-practices/" rel="noopener noreferrer"&gt;35+ Git best practices from here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So let me know did you prefer local gitignore or global gitignore file&lt;/p&gt;

</description>
      <category>git</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How you can Boost your Productivity and Code Quality in 5 days ... (PROVEN TECHNIQUE)</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Fri, 10 Jul 2020 05:29:57 +0000</pubDate>
      <link>https://dev.to/rajeevbera/how-you-can-boost-your-productivity-and-code-quality-in-5-days-proven-technique-2hhe</link>
      <guid>https://dev.to/rajeevbera/how-you-can-boost-your-productivity-and-code-quality-in-5-days-proven-technique-2hhe</guid>
      <description>&lt;p&gt;There are more than 35 &lt;a href="https://acompiler.com/git-best-practices/" rel="noopener noreferrer"&gt;git best practices&lt;/a&gt; that are available on the web.&lt;/p&gt;

&lt;p&gt;The web is full of Information... It's HUGE.&lt;/p&gt;

&lt;p&gt;BUT the truth is different&lt;/p&gt;

&lt;p&gt;It's not easy to achieve code quality by using all these git best practices and with &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;many advance git commands&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;It's hard to remember everything.&lt;/p&gt;

&lt;p&gt;And second, it's not easy to implement, especially if you are a part of a big team.&lt;/p&gt;

&lt;p&gt;Solution?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://acompiler.com/after-technique/" rel="noopener noreferrer"&gt;The AFTER technique&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The AFTER technique
&lt;/h1&gt;

&lt;p&gt;Before you jump in detail...&lt;/p&gt;

&lt;p&gt;I have something to share&lt;/p&gt;




&lt;p&gt;I used this technique and notice the boost in productivity and overall code quality improves within 5 days.&lt;/p&gt;

&lt;p&gt;Find full case study here&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  "&lt;a href="https://acompiler.com/after-technique/" rel="noopener noreferrer"&gt;How I Boost My Productivity With AFTER Technique in 5 Days&lt;/a&gt;"
&lt;/h3&gt;
&lt;/blockquote&gt;




&lt;p&gt;So let's dive into the more details of this technique&lt;/p&gt;

&lt;h2&gt;
  
  
  A — Atomic Commits
&lt;/h2&gt;

&lt;p&gt;One of the important and without a doubt, best practices in any version control is to keep your commits atomic.&lt;/p&gt;

&lt;p&gt;In simple words...&lt;/p&gt;

&lt;p&gt;Atomic commit = one commit for one change.&lt;/p&gt;

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

&lt;p&gt;git commit -m "Add JS validation to the user signup form"&lt;/p&gt;

&lt;h2&gt;
  
  
  F — Frequent Commits
&lt;/h2&gt;

&lt;p&gt;The second rule of AFTER technique is F — Frequent commits.&lt;/p&gt;

&lt;p&gt;Anytime I complete a part of code that compiles and runs, I prefer to commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  T — Test Before You Push
&lt;/h2&gt;

&lt;p&gt;I have never met any programmer who can write perfect code. To err is human.&lt;/p&gt;

&lt;p&gt;It's important to test code before you commit and especially push to the remote repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  E — Enforce standards
&lt;/h2&gt;

&lt;p&gt;Adopting standards are essential.&lt;/p&gt;

&lt;p&gt;They accelerate overall quality, and there is no doubt that full compliance always minimizes errors and delays.&lt;/p&gt;

&lt;p&gt;These standards depending on the team and other factors.&lt;/p&gt;

&lt;p&gt;You are read more about these standards here on Git Commands&lt;/p&gt;

&lt;h2&gt;
  
  
  R — Refactoring Is Not a Feature
&lt;/h2&gt;

&lt;p&gt;Code refactoring is a normal thing in developers.&lt;/p&gt;

&lt;p&gt;But the worse thing is refactoring and adding a new feature in the same commit.&lt;/p&gt;

&lt;p&gt;You should not treat refactoring as a new feature and never mix these two things.&lt;/p&gt;

&lt;p&gt;Code refactoring is not adding any value to the business.&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Section
&lt;/h2&gt;

&lt;p&gt;Here is the bonus section for you.&lt;/p&gt;

&lt;p&gt;You can download from here - &lt;a href="https://acompiler.com/git-best-practices/" rel="noopener noreferrer"&gt;Git Best Practices and AFTER techniques&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Leave a comment and let me know your thoughts.&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>ABC of Git Commands</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Wed, 24 Jun 2020 18:07:43 +0000</pubDate>
      <link>https://dev.to/rajeevbera/abc-of-git-commands-joo</link>
      <guid>https://dev.to/rajeevbera/abc-of-git-commands-joo</guid>
      <description>&lt;p&gt;If you work as a developer, you probably already know about &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;Git and Git Commands&lt;/a&gt;. And today, I will share straightforward &amp;amp; important stuff about Git Commands.&lt;/p&gt;

&lt;p&gt;Before that one question. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you know the three essential things in human life?&lt;/strong&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your Health&lt;/li&gt;
&lt;li&gt;Your Financially stability&lt;/li&gt;
&lt;li&gt;And your relationship&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes, Once you have all these basic you can achieve anything else.&lt;/p&gt;

&lt;p&gt;And the only purpose of this article to motivate you about GIT.&lt;/p&gt;

&lt;p&gt;Git is really easy to learn. &lt;/p&gt;

&lt;p&gt;Anyways. Let's come back to our original topic.&lt;/p&gt;

&lt;p&gt;In the same way if you the essential commands in Git - You can extend your learning in Git to any level.&lt;/p&gt;

&lt;p&gt;Without any further delay, let me share the ABC of Git.&lt;/p&gt;

&lt;p&gt;But before that - &lt;/p&gt;

&lt;p&gt;To understand these commands you might have to cover few other commands ( especially if you are a newbie) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A&lt;/strong&gt; - Add ( git add command)&lt;/p&gt;

&lt;p&gt;Syntax  &lt;em&gt;git add &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To add multiple files use a single dot . or -A option &lt;/p&gt;

&lt;p&gt;Syntax  &lt;em&gt;git add .&lt;/em&gt; ( to add multiple files)&lt;/p&gt;

&lt;p&gt;With the git add command, you can add new files to the staging area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B&lt;/strong&gt; - Branch ( git branch command)&lt;/p&gt;

&lt;p&gt;And one of the most significant advantages of Git is its branching model.&lt;/p&gt;

&lt;p&gt;Here is the syntax so create and delete a branch  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;git branch &lt;/em&gt;  (to create a new branch)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git branch -d &lt;/em&gt;  (to delete a local branch)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C&lt;/strong&gt; - Commit &amp;amp; Checkout ( git checkout and git commit command)&lt;br&gt;
If you want to switch and create a new branch, you can use the checkout command with -b option.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git branch &lt;/em&gt;  (to create a new branch)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git checkout &lt;/em&gt; (to navigate between the branches)&lt;/p&gt;

&lt;p&gt;If you really want to learn more in-depth you can view my latest blog post &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and let me know in comments your thoughts.&lt;/p&gt;

&lt;p&gt;I have a gift -  infographic with 51+ Git commands.  &lt;a href="https://media2.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%2Fp9f2qmx01qnlf5cyvmc3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp9f2qmx01qnlf5cyvmc3.png" alt="infographic with 51+ Git commands" width="768" height="2853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will help you to jump you from Intermediate to advanced level.&lt;/p&gt;

&lt;p&gt;Also if you are looking for a cheat sheet pdf, you can grab that from &lt;a href="https://acompiler.com" rel="noopener noreferrer"&gt;aCompiler &lt;/a&gt; blog.&lt;/p&gt;

&lt;p&gt;The only purpose of this article to show you two things &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's not hard to learn Git&lt;/li&gt;
&lt;li&gt;And to share Git cheat sheet that really helped me. Download  &lt;a href="https://acompiler.com/git-commands/" rel="noopener noreferrer"&gt;infographics and PDF&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do you like or dislike the ABC of Git?&lt;/p&gt;

&lt;p&gt;If you want to connect with me you can email me or write to me &lt;a href="https://acompiler.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Either way, let me know your thoughts.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>Basic Git Commands</title>
      <dc:creator>Rajeev Bera</dc:creator>
      <pubDate>Mon, 15 Jun 2020 04:22:47 +0000</pubDate>
      <link>https://dev.to/rajeevbera/basic-git-commands-ge7</link>
      <guid>https://dev.to/rajeevbera/basic-git-commands-ge7</guid>
      <description>&lt;p&gt;&lt;strong&gt;If you want to use git to it's full potential, you must know about Git commands.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Can you drive a car if it's does not have any fuel ?&lt;br&gt;
No&lt;/p&gt;

&lt;p&gt;Fuel is an essential element for car. &lt;/p&gt;

&lt;p&gt;Similarly, &lt;a href="https://acompiler.com/git-commands" rel="noopener noreferrer"&gt;Git commands&lt;/a&gt; are essentials. You have to master this skill at some stage, especially if you are a software developer.&lt;/p&gt;

&lt;p&gt;Git is popular,&lt;a href="https://docs.microsoft.com/en-us/azure/devops/learn/devops-at-microsoft/use-git-microsoft" rel="noopener noreferrer"&gt;Microsoft uses git&lt;/a&gt;. So there is no doubt why its important.&lt;/p&gt;

&lt;p&gt;And today I will show you five basic git commands which will help you to a kick start your git journey.&lt;/p&gt;

&lt;h4&gt;
  
  
  git --version
&lt;/h4&gt;

&lt;h4&gt;
  
  
  git add 
&lt;/h4&gt;

&lt;h4&gt;
  
  
  git add -A
&lt;/h4&gt;

&lt;h4&gt;
  
  
  git status
&lt;/h4&gt;

&lt;h4&gt;
  
  
  git commit -m “your commit message”
&lt;/h4&gt;

&lt;p&gt;So lets dive in more details &lt;/p&gt;

&lt;h3&gt;
  
  
  git --version
&lt;/h3&gt;

&lt;p&gt;You can check your current version if git with git --version command&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqvad9r955vlesuksk5s0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqvad9r955vlesuksk5s0.png" alt="Alt Check git version control with command line" width="581" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this you can make sure that you are not using the old version.&lt;/p&gt;

&lt;h3&gt;
  
  
  git add 
&lt;/h3&gt;

&lt;p&gt;Git add command will use to add new files to the staging area.&lt;/p&gt;

&lt;p&gt;With the gid add  command you can add single file to the staging area&lt;/p&gt;

&lt;h3&gt;
  
  
  git add -A
&lt;/h3&gt;

&lt;p&gt;And with git add -A command you can add multiple files into the staging area.&lt;/p&gt;

&lt;p&gt;Here -A is a switch or option and  A stands for all.&lt;/p&gt;

&lt;p&gt;Also you can use git add . command, to add all files into the git staging area.&lt;/p&gt;

&lt;h3&gt;
  
  
  git status
&lt;/h3&gt;

&lt;p&gt;It is one of the important command. You can check your current branch and list of files which are required to commit &lt;/p&gt;

&lt;h3&gt;
  
  
  git commit -m “your commit message”
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fljx0n2mtjpul6jkj41cw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fljx0n2mtjpul6jkj41cw.png" alt="Alt git commit" width="768" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are ready to commit your changes it's time to commit. &lt;/p&gt;

&lt;p&gt;Here -m option stand for your message. You want to commit with some message so you can refer that later.&lt;/p&gt;

&lt;p&gt;Also in case if you want yo update your last commit message you can use &lt;/p&gt;

&lt;p&gt;git commit --amend -m "your updated commit message"&lt;/p&gt;

&lt;p&gt;So basically, git commit will add your changes to git repository from staging.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is git staging area
&lt;/h3&gt;

&lt;p&gt;Pictures speak louder than words.&lt;/p&gt;

&lt;p&gt;Here is the one&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fp87urm4ayi5mobuvcije.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp87urm4ayi5mobuvcije.png" alt="Alt git staging area" width="518" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically staging is a middle step between your working directory and repository.&lt;/p&gt;

&lt;p&gt;I have a complete list and a bonus cheat sheet for you to download here.&lt;/p&gt;

&lt;p&gt;Hope it's easy for your to understand these git commands.&lt;/p&gt;

&lt;p&gt;Let me know in by comment about your git journey.&lt;/p&gt;

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