SlideShare a Scribd company logo
1 of 18
Git Learn
From the scratch
Prepared By:
Mir Arif Hasan
B. Sc in CSE at AUST, BD
Email: arif.ishan05@gmail.com
1
Topics 1. Introduction of Git & GitHub
2. Why Git?
3. Git configuration
4. Creating repository, Init, Remote add, Clone
5. Git file status
6. Git Add, Commit, Ammand, Log, Push, Pull
7. Branching, Checkout
8. Merge, Conflicts
9. Collaboration
10. Pull request
2
Introduction of Git & GitHub
Git:
Git is a version control system
You can manage your files version through Git
Gives the scope for open source development
Anyone can update your public repo and request you to
add them
GitHub:
GitHub is a server where the files are stored
3
Why Git?
4
Git is a distributed
version control system
Git Configuration
5
Download & install Git software
Open git bash command to configure
Write below commands:
1. git config --global user.name “<your username>”
2. git config --global user.email <your email>
You can see/test by
1. git config user.name
2. git config user.email
Or, git config --list
*See next page example
Git Configuration
6
Create Repository
7
Create Repository
8
If select public, anybody
can see your repository
Create Repository
9
Copy the HTTP link
Link your repository with local
10
Two way to link up
Clone
[If you have not create any project on your
local server]
Remote add
[If you already started with your project
locally, but you have a new repository]
NB: If you both work on your local and have a old repository, then you should go “Remote add” then
“git pull origin <branch>” and resolve conflicts(if need).
Git Clone
11
Use any command:
1. git clone <HTTP link>
2. git clone <HTTP link> <directory>
You can think ‘clone’ like ‘download’.
Where you open git bash and apply 1st
cmd, there the repo will be download.
Otherwise, there create a directory
then, it will download in the directory.
Remote Add
12
Step 1:
Go to your project folder.
Step 2:
Use command: “git init”
Explanation: For initialize git on that folder
Step 3:
Use command: “git remote add origin <repo url>”
Explanation: For link with remote repository
Step 4: (Optional)
Use command: “git pull origin <branch_name>”
Explanation: If your remote repo is not blank repo.
Git Commands
Local Server - Your PC
Remote Server - GitHub / Cloud
When we init/clone, a ‘.git’ hidden file
generates to track our files and other
data.
git status - Gives the overview of files
git add - Adding file for commit
git commit - Saving for upload/push
git push - Uploading to remote server
git pull - Bringing the change from
remote to local
git branch - See a list of branch
git checkout - Changing branch
13
Git Commands
14
Command 1: “git status”
Explanation: Gives a list of files which are modified, untract etc. You can use this cmd in any
stage.
Command 2: “git add <file name>” or “git add . ”
Explanation: Now you have to select files for the next commit.
Command 3: “git commit -m ‘<comment>’”
Explanation: You are saving your changes by committing. You should pass a comment about what
features add or bug fixed.
Command 5: “git push -u origin master” or “git push -u origin <branch_name>”
Explanation: To upload your project in remote. You have to mention branch name in
command.
Command 6: “git pull origin master” or “git pull origin <branch_name>”
Explanation: This command is for getting all updates from remote to local. Updates will come
Branch
15
Maste
r
Maste
r
Maste
r
pushcheckout pull & pushcheckout
checkout
checkout
pull & push
pull & push
master
signup
login
Branch & Checkout
16
List of branches:
git branch
Create a branch:
git branch <branch_name>
Switching to another branch:
git checkout <destination_branch_name>
Create and switch:
git checkout -b <destination_branch_name>
Some other commands
17
To see all files and folder
ls -la
To visit a directory
cd <directory_name>/
To clear git cmd GUI
clear
For stop current execution
ctrl + c
18
Thank You

More Related Content

What's hot

Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists Steven Hamblin
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitLuigi De Russis
 
Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / GithubPaige Bailey
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial IJim Yeh
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitJason Byrne
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of troubleJon Senchyna
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to gitEmanuele Olivetti
 
Version control system
Version control systemVersion control system
Version control systemAndrew Liu
 
From svn to git
From svn to gitFrom svn to git
From svn to gitNehal Shah
 
Web Programming - Git basics
Web Programming - Git basicsWeb Programming - Git basics
Web Programming - Git basicsÖmer Taşkın
 
Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control systemJeroen Rosenberg
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitRasan Samarasinghe
 

What's hot (20)

Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Git commands
Git commandsGit commands
Git commands
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / Github
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Version control system
Version control systemVersion control system
Version control system
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Web Programming - Git basics
Web Programming - Git basicsWeb Programming - Git basics
Web Programming - Git basics
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control system
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git basic
Git basicGit basic
Git basic
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
 

Similar to Git learn from scratch

Git basic and workflow
Git basic and workflowGit basic and workflow
Git basic and workflowbuikhanhbk
 
Git, Beginner to Advanced Survey
Git, Beginner to Advanced SurveyGit, Beginner to Advanced Survey
Git, Beginner to Advanced SurveyRafal Rusin
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践Terry Wang
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践Terry Wang
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 
Atlanta Pm Git 101
Atlanta Pm Git 101Atlanta Pm Git 101
Atlanta Pm Git 101Jason Noble
 

Similar to Git learn from scratch (20)

Git basic and workflow
Git basic and workflowGit basic and workflow
Git basic and workflow
 
Git, Beginner to Advanced Survey
Git, Beginner to Advanced SurveyGit, Beginner to Advanced Survey
Git, Beginner to Advanced Survey
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
 
Git presentation
Git presentationGit presentation
Git presentation
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
GitSetupLinux
GitSetupLinuxGitSetupLinux
GitSetupLinux
 
Git setuplinux
Git setuplinuxGit setuplinux
Git setuplinux
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git101
Git101Git101
Git101
 
GIT
GITGIT
GIT
 
Learning git
Learning gitLearning git
Learning git
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
Atlanta Pm Git 101
Atlanta Pm Git 101Atlanta Pm Git 101
Atlanta Pm Git 101
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Git learn from scratch

  • 1. Git Learn From the scratch Prepared By: Mir Arif Hasan B. Sc in CSE at AUST, BD Email: arif.ishan05@gmail.com 1
  • 2. Topics 1. Introduction of Git & GitHub 2. Why Git? 3. Git configuration 4. Creating repository, Init, Remote add, Clone 5. Git file status 6. Git Add, Commit, Ammand, Log, Push, Pull 7. Branching, Checkout 8. Merge, Conflicts 9. Collaboration 10. Pull request 2
  • 3. Introduction of Git & GitHub Git: Git is a version control system You can manage your files version through Git Gives the scope for open source development Anyone can update your public repo and request you to add them GitHub: GitHub is a server where the files are stored 3
  • 4. Why Git? 4 Git is a distributed version control system
  • 5. Git Configuration 5 Download & install Git software Open git bash command to configure Write below commands: 1. git config --global user.name “<your username>” 2. git config --global user.email <your email> You can see/test by 1. git config user.name 2. git config user.email Or, git config --list *See next page example
  • 8. Create Repository 8 If select public, anybody can see your repository
  • 10. Link your repository with local 10 Two way to link up Clone [If you have not create any project on your local server] Remote add [If you already started with your project locally, but you have a new repository] NB: If you both work on your local and have a old repository, then you should go “Remote add” then “git pull origin <branch>” and resolve conflicts(if need).
  • 11. Git Clone 11 Use any command: 1. git clone <HTTP link> 2. git clone <HTTP link> <directory> You can think ‘clone’ like ‘download’. Where you open git bash and apply 1st cmd, there the repo will be download. Otherwise, there create a directory then, it will download in the directory.
  • 12. Remote Add 12 Step 1: Go to your project folder. Step 2: Use command: “git init” Explanation: For initialize git on that folder Step 3: Use command: “git remote add origin <repo url>” Explanation: For link with remote repository Step 4: (Optional) Use command: “git pull origin <branch_name>” Explanation: If your remote repo is not blank repo.
  • 13. Git Commands Local Server - Your PC Remote Server - GitHub / Cloud When we init/clone, a ‘.git’ hidden file generates to track our files and other data. git status - Gives the overview of files git add - Adding file for commit git commit - Saving for upload/push git push - Uploading to remote server git pull - Bringing the change from remote to local git branch - See a list of branch git checkout - Changing branch 13
  • 14. Git Commands 14 Command 1: “git status” Explanation: Gives a list of files which are modified, untract etc. You can use this cmd in any stage. Command 2: “git add <file name>” or “git add . ” Explanation: Now you have to select files for the next commit. Command 3: “git commit -m ‘<comment>’” Explanation: You are saving your changes by committing. You should pass a comment about what features add or bug fixed. Command 5: “git push -u origin master” or “git push -u origin <branch_name>” Explanation: To upload your project in remote. You have to mention branch name in command. Command 6: “git pull origin master” or “git pull origin <branch_name>” Explanation: This command is for getting all updates from remote to local. Updates will come
  • 15. Branch 15 Maste r Maste r Maste r pushcheckout pull & pushcheckout checkout checkout pull & push pull & push master signup login
  • 16. Branch & Checkout 16 List of branches: git branch Create a branch: git branch <branch_name> Switching to another branch: git checkout <destination_branch_name> Create and switch: git checkout -b <destination_branch_name>
  • 17. Some other commands 17 To see all files and folder ls -la To visit a directory cd <directory_name>/ To clear git cmd GUI clear For stop current execution ctrl + c