Getting Started Git
Published on
Git
Git is a Distributed Version Control System designed to handle everything from small to very large projects with speed and efficiency.
After the Installation of Git in Linux, do this one time steps to the have User Name and Email for pushing to the central repo.
git config --global user.name "Name"
git config --global user.email "name@gmail.com"
-
Initialize Git
git initThis command creates a new Git repository or convert an existing, unversioned project to Git project.
-
Status Check
git statusCheck the status of the Git repo to determine in which area the code is currently avaliable.

-
Add Code
git add <filename> / git add .Adds the code from Working area to Stagging area.
To Restore the Code from stagging area to working directory use:-
git restore --staged <file> -
Commit Code
git commit -m "message" <filename>/.Commits the file from stagging area to local repo.
Notes :- Once the file have been commited, their is no way to delete that commit.
-
Show Commit
git show <commit_id>To see the changes made in a commit we use the following above command.
Thank you for reading. This article is part of the PaperAstro starter template.