6 Git commands you should know!

Git is one of the most essential skills you should have not only if you are aspiring to be Data Scientist, but generally for all software development roles.

What is Git? Version Control.

When you work in teams, there is a need to manage the historical workflow and timelines of changes in code, files and directories by multiple members.

Let’s have a quick look over 6 basic commands:

:white_check_mark:git init is used to initialize git for version control in your local current directory.

:white_check_mark:git add adds the mentioned file to the staging area. To add all files in the directory, use "git add . "

Staging area can be thought of as a launch pad where the files are moved before being committed.

This is crucial as you wouldn’t want to commit all the changes in one go, rather move them onto staging area and commit one-by-one.

:white_check_mark:git status shows what all files are present in the staging area.

:white_check_mark:git commit can be considered as taking a snapshot of the current files in the staging area.

:white_check_mark:git remote is used to create/remove connections to other repositories. The “origin” here is just a convinient name or alias of the repo URL where you want to connect.

:white_check_mark:git push finally pushes the files to the main branch of the repository.

#git #datascience #python