Git & GitHub

Hello! I'm a student passionate about becoming a Cloud and DevOps Engineer. I have a solid foundation in AWS Cloud, Linux, Docker, and Kubernetes.
What is git and GitHub
Git: Git is a Distributed version control system or Software. which is used for storing the different versions of the code and is also used for collaboration.
Distributed version control system solves the problem of "single point of failure" which is a drawback of Centralized version control system.
Centralized and Distributed Version control system: Distributed Version control system stores the code in a Server and if that server is down developers cannot collaborate to work together.
On the other had in Distributed version control system the copy of the code is stored locally in the developers laptop, even if Remote Server is down developer have code in their own local repo.
GitHub: GitHub is a platform for version control and collaborative software development. it uses git Version Control system.
Git Commands
1. git init : inintialize git repo , a .git repository is created.
2. git status : shows the status of working directory.
3. gitiff : shows the changes.
4. git add d <file_name> : add the file in staging area.
5. git commit -m"message": Records changes of the repository with message.
6. git log : Show commit history.
Git Branching
Branch allows you to work on the different feature on isolation form from each other.
master or main is the default or active branch.
1. git branch : lists branches
2. git branch <branch_Name> : create branch
3. git checkout <branch_Name> : switch branch
4. git checkout -b <branch_Name> : create & switch into branch
5. git log <branch_Name> : check log from another branch
6. git merge <branch_Name> : merge the branch into this branch
7. git cherry-pick <commid_Id> : merge specific commits
8. git branch -d <branch_Name> : delete branch
9. git clone <url> : clone the repo locally.
fork and clone : fork is used to create a copy of the repo while clone is used to download.
Thankyou for Reading.



