Learn Git in 10 minutes.

Learn Git in 10 minutes.

download.png

Have u been surfing the web lately?, looking for the best guide to learn git?.

Then relax as this article takes you through the process of becoming a professional in version control system, Git and Github for personal use and also open source projects.

In this article you will learn about git and some of the important git commands every developer should know, and how to apply it to live projects. And also why Git and GitHub are necessary for the development of software and where and when they come handy.

This article will take you deep into the concept of git and version control system right from the scratch, so make sure you ride along till the end of this article.

Why is Git Important?

Git is a free open source version control system (VCS) and obviously the most widely u used version control system in the world, used for branching, merging and tracking changes in computer files and projects, and it was originally created by Linus Torvalds in 2005.

Git and (VCS) makes it possible for developers to collaborate and work together remotely on the same project thereby saving time and increasing productivity and also workflow. It is an important tool that every developer should know because its uses will always be found in your entire career as a software developer.

Git supports numerous programming languages like Java, c#, c++, JavaScript, python, PHP and all other programming languages so it is not language-dependent.

Git is the most widely used version control system in the world.

Core importance of git.

  1. Git makes it possible for developers to collaborate and work together on both remote and local projects.

  2. Git helps developers to keep projects organised and arranged for easy accessibility and refrences

  3. Git helps developers keep track of all code histories and changes commited to your project.

  4. Git enables developers to create branches off the main branch so as not to alter the content of the main branch in a project.

  5. Git enables developers to clone and contribute to open source projects.

How Git Works

Git is a software that runs locally on your machine. To get Git working you must use it alongside online host such as Github or Bitbucket to store copy of files.

It also provides you a central location where you can upload your changes and download changes from others, Git can automatically merge the changes, so two people can even work on different parts of the same file and later merge those changes without loosing each other’s work.

How To Install Git

Git is absolutely free and can be downloaded from the internet, Git can be installed on any operating systems such as Mac OS X, Windows and Linux.

Installing Git for Windows

On your Windows machine, the website automatically provides the Download button for Windows or download git HERE.

Upon clicking the button, you will be prompted to save the setup file. Choose your preferred location to save the file and you are good to go.

Follow the procedures below to install git on windows:

Double-click on the downloaded setup file to get started with the installation.

The steps are pretty self-explanatory but ensure to adhere to the safe to follow procedure, and I also advise that you reboot your machine after successful download.

At a point in the process you will encounter a component configuration screen where you will need to select the Git bash here and Git GUI here options.

And you will also see a screen where you will need to chose the option which says run Git from the Windows command prompt.

This setting is important for people who will be using command lines to control Git and its activities.

Congratulations you have successfully installed git into your windows machine.

Then head over to the GitHub official website and click the signup button, fill the necessary details, and get an account with GitHub. You can also learn more on GitHub and open source projects HERE.

After successfully creating a GitHub account, type the following command to configure Git.

To verify if git is installed type the following command in the command prompt:

git --version

To personalize your projects type the following command in the command prompt:

git config --global user.name "your-GitHub-username"

To connect your email type the following command in the command prompt:

git config --global user.email "your-email-address"

Then you can start working on GitHub and the command line.

10 Useful Git Commands

  1.      git init
    

    This command tells git that you want to initialize a local Git repository in this folder, and also keeps track of the files in this folder. it allows us to use the git commands in our projects.

  2.     git add
    

    This command tells Git to add files you specify to the staging area and make them ready for commit.

  3.    git rm
    

    This command tells Git to remove files you specify from the staging area.

  4.  git commit
    

    This command tells Git to take a snapshot of changes that occur in your files.

  5.    git status
    

    This command tells Git to show you the changes that are both tracked and untracked in the working tree and the current branch.

  6.   git log
    

    This command allows us to see all the commits made in git and the current branch.

  7.   git pull
    

    This command is used to fetch latest changes from a remote repository and immediately update the local repository.

  8.   git push
    

    This command is used to upload the latest changes made in the local repository to the remote repository.

  9.   git clone
    

    used to clone a remote repository into your folder on your local machine.

  10.       git checkout
    

    This command tells Git to check out a branch or repository that you are not currently inside of.

    Check out more Git and Github command HERE.

CONCLUSION

Congratulations you have learnt what Git is, the importance, uses, how to install Git in your local machine and also the different Git commands and their uses.

There are many more commands and variations that you may find useful as part of your work with Git. To learn more about all of your available options, you can run the following to receive useful information.

  git help

If you also have any question to ask leave it in the responsive section or mail me.

Thanks for reading.