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
 
Git setuplinux
Git setuplinuxGit setuplinux
Git setuplinux
 
GitSetupLinux
GitSetupLinuxGitSetupLinux
GitSetupLinux
 
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

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

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