0% found this document useful (0 votes)
5 views

Git Commands Tech

The document provides an overview of Git and GitHub, highlighting their importance as version control systems for software development. It explains the differences between Git, a local version control system, and GitHub, a cloud-based platform for hosting Git repositories. Additionally, it outlines Git workflows, commands, and branch management techniques essential for effective collaboration and code management.

Uploaded by

sumanth7021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Git Commands Tech

The document provides an overview of Git and GitHub, highlighting their importance as version control systems for software development. It explains the differences between Git, a local version control system, and GitHub, a cloud-based platform for hosting Git repositories. Additionally, it outlines Git workflows, commands, and branch management techniques essential for effective collaboration and code management.

Uploaded by

sumanth7021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Git & GitHub

With NOTES by Tech Jashwanth


In this Video.....
Version Control System Imp of GIT GIT Usecases What is GIT?

Why GIT? What is GitHub? Difference Between GIT & GitHub

GIT Setup GIT + VS Code GIT Workflow GIT add GIT Commit

GIT Push & Pull GIT Branchs GIT Merge GIT Merge Conflicts

GIT Commands
What is Version Control?
Version control is a system that tracks changes to files over time, allowing
developers to revert to previous versions, collaborate efficiently, and manage
different code versions.
It prevents data loss and ensures smooth teamwork in software development.
With out Git
Your Laptop
Project 1 Folder Project 1 Folder Project 1 Folder
Code Code Code

Code V2 Code V2

Code V3

Project 2 Folder Project 2 Folder Project 2 Folder


Code Code Code

Code V2 Code V2

Code V3
With Git
Your Laptop

Project 1 Git Repo

Code Code V2 Code V3 Code Vn

Project 2 Git Repo

Code Code V2 Code V3 Code Vn

Repo: Repo is a folder where git is initialized


What is Git?
Git is a distributed version control system that tracks changes in code, allowing
multiple developers to collaborate efficiently.
Use Cases of Git

Software Development

Project Management

Tracking Versions
With out GitHub

Your Laptop Frnd 1 Laptop

Code Gmail / Whatsapp / etc Code

Code V2 Code V2

Code V3 Gmail / Whatsapp / etc Code V3


With out GitHub
Frnd 2 Laptop

Code

G
tc

m
/e

ai
p

l/
Code V2

ap

W
ts

ha
ha

ts
tc

G
W

ap
m
/e
l/

ai

p
ai

l/

/e
ap
m
Code V3

tc
G

ts

ha
ha

ts
W

ap
l/

p
ai

/e
m

tc
G
Your Laptop Frnd 1 Laptop

Code Gmail / Whatsapp / etc Code

Code V2 Code V2

Code V3 Gmail / Whatsapp / etc Code V3


With GitHub
Frnd 2 Laptop Frnd 3 Laptop

Local Repo Local Repo

Your Laptop
Frnd 1 Laptop
Local Repo Local Repo

Github
What is GitHub?
GitHub is a cloud-based platform that hosts Git repositories, enabling developers to
collaborate, manage code, and track changes efficiently.
Diff between GIT & GitHub
Git:
Git works locally to track the changes in folders and Files. helps in organizing the
code with the help of Branches.

GitHub:
A cloud platform that hosts the local repo online. so that anyone with the repo link
can access the project and contribute changes
GIT Setup
In Local System
GitHub Setup
Git Configuration
GIT
Demo
Git Workflow

Local Staging
Comitted
Files Area Changes
Git Workflow
1. git add --all / git add .
This command will add the files to the staging area

2. git commit -m ‘message’


This command will Commit the Changes locally.
Git Workflow

Local Repo

Local git add --all Staging git commit -m ‘message’


Comitted
Files Area Changes
Git Workflow
1. git add --all / git add .
This command will add the files to the staging area

2. git commit -m ‘message’


This command will Commit the Changes locally.

3. git push remoteName BranchName


This command will push the changes from local
repo to GitHub
Git Workflow

Local Repo

git add git commit - git push remoteName


Local --all Staging m ‘message’ Comitted BranchName

Files Area Changes

Github
Git Workflow

git pull remoteName


BranchName

Local Repo
Latest changes in the

Github branch
Git Branches

Project Project

OR
Page 1 Feature 1

Page 2 Feature 2
Git Branches

Local Repo

Branch 1

Page 1 Code

Branch 2

Page 2 Code
Git Branch Commands
1. git branch – Lists all local branches in the repository.
2. git branch <branch-name> – Creates a new branch with the specified name.
3. git checkout <branch-name> / git switch <branch-name> – Switches to the
specified branch.
4. git checkout -b <branch-name> / git switch -c <branch-name> – Creates and
switches to a new branch.
5. git merge <branch-name> – Merges the specified branch into the current
branch.
6. git branch -d <branch-name> – Deletes a local branch (only if fully merged).
7. git branch -D <branch-name> – Force deletes a local branch.
8. git push origin --delete <branch-name> – Deletes a remote branch.
9. git branch -m <old-name> <new-name> – Renames a branch.
10. git branch -r – Lists remote branche

You might also like