← Go Back

Git Tutorial: Getting started with Version Control.

Goals

What is Git?

Git is a version control system (VCS) for code.It is used to track the code changes.

Installation

Open the Terminal program. Type git --version and press enter. If a version number is returned, Git is already installed. If something along the lines of -bash: git: command not found pops up, install it.

Basic Git command reference

How to configure your git account

git config --global user.name "Firstname Lastname"

git config --global user.email username@email.com

This is the basic email and username setup.

Push code to github

git init

Initialize a git repository

git remote add origin https://github.com/you/project

Now by adding files to directory follow the above command

Now check the status of your repository by using

git status

Now to add the all files to the repo use the below command

git add.

Now to commit tracked files in git use below command

git commit -m "Initial Commit"

Finally push this to github

git push

Hence this is the git tutorial and all the commands that's the pretty much needed.Happy coding!