What is Git and Github

What is Git and Github

Git :

Git is a distributed version control system. In simple word git is a (software) tool which is used to manage our source code. It is used to tracking changes in the source code. It allow multiple developer to work together.

Features of Git

  • Tracks history

  • Free and open source

  • Scalable

  • Easier Branching

  • Support non-linear development

  • Creates backup

Bare Minimum Commands in Git:

  • Set up global config variables - This command is used to show the username and email on GitHub so that we can check that who is checking the code in and out. This is very helpful when we are working with other developer. ```

git config --global user.name "prithviraj" git config --global user.email "" ```

  • git init - This command is used to create a new git repository.

  • git add . - This command is used to adds a changes in the working directory to staging area.

  • git commit - This command is used to create a commit. In simple term like it create a snapshot of our repository, it is used to save our changes in the local repository. This command only executed after the "git add" command because **"git commit" **command only save those changes that were added by the "git add" command.
    Important option:
    **-m = ** This option is used to set the commit message for understand ourself and our teammates what happened.

>>> git commit -m "Message"

**--amend = ** This option is used to rewrite the recent commit messages.

>>> git commit --amend -m "New Message"
  • git push - This command is used to upload your local repository content to remote repository. In that command if we do not specify the location of repository, then it will push the default location origin master.
>>> git push origin "branch name"

Here origin is the alias on our system of remote repository.

GitHub:

GitHub is a Git repository hosting service that provide the web-based graphical interface. It host our project source code in any programming language, it also keep tracks the various changes made by the programmers