Learn Basic Git Commands for Your Data Science Works

 

Git as a Version Control System

Image for post
Image for post
Illustration of git as a versioning tool (Image by Author)

How to Install Git

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
# Check our git version
git --version
Image for post
Git version 2.17.1 (Image by Author)

Configuration

# Setup the git configuration
git config --global user.name "your-username"
git config --global user.email "your-email"
Image for post
Set up git configuration (Image by Author)
Image for post
Check out our git global configuration (Image by Author)

Git as Versioning Tools

Image for post
Initialization of git (Image by Author)
Image for post
The directory inside .git folder after git initialization (Image by Author)
Image for post
Create a new file to interact with git (Image by Author)
Image for post
Status of README.md in modified state (Image by Author)
Image for post
Status of README.md after running git add command (Image by Author)
Image for post
The README.md has been committed (Image by Author)

Git Lifecycle

Image for post
Git life-cycle (Image by Author)

Keep Tracking our Logs

Image for post
Modify our README.md file and commit it (Image by Author)
Image for post
Commit logs in git (Image by Author)
Image for post
Using git diff to compare two conditions in git (Image by Author)

Move Backward to the Previous States

Image for post
Implementation of git reset command in git (Image by Author)
Image for post
Git reset command (Image by Author)
Image for post
The implementation of git reflog to recover project history (Image by Author)
Image for post
Commit logs in git (Image by Author)
Image for post
Commit logs in git (Image by Author)
Image for post
Check commits with git checkout command (Image by Author)
Image for post
Tilde and caret on HEAD (Image by Author)

Git as Collaboration Tools — Branching

Image for post
Create a new branch and add a new line in README.md file (Image by Author)
Image for post
Checkout to the master and add a new line in README.md file (Image by Author)
Image for post
Commit logs with a new branch in git (Image by Author)

Git as Collaboration Tools — Merging

Image for post
Merging new_branch to the master and manage conflicts (Image by Author)
Image for post
Commit logs in git (Image by Author)
Image for post
Revision and author last modified in a README.md file (Image by Author)

Git as Collaboration Tools — Remote Repository

Image for post
Create a new repository in GitHub (Image by Author)
Image for post
Manage remote repository and upload into it (Image by Author)

Summarization

Notes

References

Comments

Popular posts from this blog

Flutter for Single-Page Scrollable Websites with Navigator 2.0

A Data Science Portfolio is More Valuable than a Resume

Better File Storage in Oracle Cloud