SlideShare a Scribd company logo
1 of 8
Linux GIT commands 
Raj Kumar Rampelli
What is Git in linux 
 Distributed revision/version control system and Source 
code manager 
 Features: 
 Speed 
 Data Integrity 
 Distributed & Non linear work flow 
 More info: try 
man git 
 Source: [Wikipedia]
Frequently used git commands 
 Git <command> --help 
 git status 
 List the files changes in current working directory 
 git diff 
 Show the changes to track the files 
 git diff <commit_id1> <commit_id2> 
 Show the changes between commit ids id1 and id2 
 git diff <branch1> <branch2> 
 Show the changes between branch1 and branch2
Git commands-2 
Command Use 
git log Changes history in the current 
working branch. List all changes 
that are merged in this branch 
git log <file_name> Change history of specified file 
git show <commit_id> Show the exact change in the 
specified commit id 
git show <branch_name> Show the last commit id 
information in the specified 
branch 
git branch List all local branches, and * 
indicates the current branch 
git branch –a | head List the root branch name for 
this branch, i.e. upstream 
repository name
Git commands-3 
Command Use 
git checkout –b <branch_new> 
<branch_repository> 
Creates a branch based on the 
other branch 
(branch_repository) and switch 
to new branch (branch_new) 
git checkout <branch> Switch to already existing local 
branch 
git branch –d <branch_name> Deletes branch 
git pull Pulls the latest changes from 
origin and merge them 
Git fetch Fetch the latest changes from 
origin but not merge locally. 
git add <file_name> Add files to the index 
git commit Record the changes to the 
repository
Git commands-4 
Commands Use 
git push Update remote refs along with 
associated objects 
Git rebase Forward-port local commits to 
the updated upstream head 
git reset Reset current HEAD to the 
specified state 
git revert <commit_id> Revert/delete exisitng commit 
git blame <file_name> Show changes in the file and 
author last modified each line 
of a file 
git help Display help info about git
Finding regression using 
git bisect command 
 Step1: git bisect start 
 Step2: git bisect good <commit_id> 
 Last working commit id 
 Step3: git bisect bad <commit_id> 
 This commit id is last broken version 
 Step4: New commit id will be generated in step3. 
 Now, HEAD is at this new commit id. 
 Build, flash the device and check the current version of code is 
working or broken. 
 If broken, then new commit is bad 
 Else, the new commit is good 
 Now, assign this commit id to good/bad commit id and follow the 
same steps from step2 till you find the culprit commit. 
 Please check the discussion at 
http://stackoverflow.com/questions/4713088/how-to-use-git-bisect
THANK YOU  
Have a look at 
My PPTs: www.slideshare.net/rampalliraj/ 
My Blog: http://practicepeople.blogspot.in/

More Related Content

What's hot

Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
Abdul Basit
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
Daniel Tai
 

What's hot (18)

Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
 
Git hub abduallah abu nada
Git hub   abduallah abu nadaGit hub   abduallah abu nada
Git hub abduallah abu nada
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Git commands
Git commandsGit commands
Git commands
 
A Simple Introduction to Git
A Simple Introduction to GitA Simple Introduction to Git
A Simple Introduction to Git
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git Workshop
Git WorkshopGit Workshop
Git Workshop
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Git presentation
Git presentationGit presentation
Git presentation
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primer
 
Git for the absolute beginners
Git for the absolute beginnersGit for the absolute beginners
Git for the absolute beginners
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Git for beginner
Git for beginnerGit for beginner
Git for beginner
 
Git 01
Git 01Git 01
Git 01
 
Git Cards - Keynote Format
Git Cards - Keynote FormatGit Cards - Keynote Format
Git Cards - Keynote Format
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 

Viewers also liked

Viewers also liked (8)

Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
Learn python – for beginners
Learn python – for beginnersLearn python – for beginners
Learn python – for beginners
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Network security and cryptography
Network security and cryptographyNetwork security and cryptography
Network security and cryptography
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2
 
Linux watchdog timer
Linux watchdog timerLinux watchdog timer
Linux watchdog timer
 

Similar to Linux GIT commands

Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang
 

Similar to Linux GIT commands (20)

Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git
GitGit
Git
 
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
 
Git github
Git githubGit github
Git github
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
GITHappens, powerpoint about git and github
GITHappens, powerpoint about git and githubGITHappens, powerpoint about git and github
GITHappens, powerpoint about git and github
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Git and Github - A primer
Git and Github - A primerGit and Github - A primer
Git and Github - A primer
 
Git learning
Git learningGit learning
Git learning
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Version control system
Version control systemVersion control system
Version control system
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git cheat sheet with diagram-5.pdf
Git cheat sheet with diagram-5.pdfGit cheat sheet with diagram-5.pdf
Git cheat sheet with diagram-5.pdf
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
 

More from RajKumar Rampelli

More from RajKumar Rampelli (7)

Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
 
Introduction to Python - Running Notes
Introduction to Python - Running NotesIntroduction to Python - Running Notes
Introduction to Python - Running Notes
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Sql injection attack
Sql injection attackSql injection attack
Sql injection attack
 
Turing awards seminar
Turing awards seminarTuring awards seminar
Turing awards seminar
 
Higher education importance
Higher education importanceHigher education importance
Higher education importance
 
C compilation process
C compilation processC compilation process
C compilation process
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Linux GIT commands

  • 1. Linux GIT commands Raj Kumar Rampelli
  • 2. What is Git in linux  Distributed revision/version control system and Source code manager  Features:  Speed  Data Integrity  Distributed & Non linear work flow  More info: try man git  Source: [Wikipedia]
  • 3. Frequently used git commands  Git <command> --help  git status  List the files changes in current working directory  git diff  Show the changes to track the files  git diff <commit_id1> <commit_id2>  Show the changes between commit ids id1 and id2  git diff <branch1> <branch2>  Show the changes between branch1 and branch2
  • 4. Git commands-2 Command Use git log Changes history in the current working branch. List all changes that are merged in this branch git log <file_name> Change history of specified file git show <commit_id> Show the exact change in the specified commit id git show <branch_name> Show the last commit id information in the specified branch git branch List all local branches, and * indicates the current branch git branch –a | head List the root branch name for this branch, i.e. upstream repository name
  • 5. Git commands-3 Command Use git checkout –b <branch_new> <branch_repository> Creates a branch based on the other branch (branch_repository) and switch to new branch (branch_new) git checkout <branch> Switch to already existing local branch git branch –d <branch_name> Deletes branch git pull Pulls the latest changes from origin and merge them Git fetch Fetch the latest changes from origin but not merge locally. git add <file_name> Add files to the index git commit Record the changes to the repository
  • 6. Git commands-4 Commands Use git push Update remote refs along with associated objects Git rebase Forward-port local commits to the updated upstream head git reset Reset current HEAD to the specified state git revert <commit_id> Revert/delete exisitng commit git blame <file_name> Show changes in the file and author last modified each line of a file git help Display help info about git
  • 7. Finding regression using git bisect command  Step1: git bisect start  Step2: git bisect good <commit_id>  Last working commit id  Step3: git bisect bad <commit_id>  This commit id is last broken version  Step4: New commit id will be generated in step3.  Now, HEAD is at this new commit id.  Build, flash the device and check the current version of code is working or broken.  If broken, then new commit is bad  Else, the new commit is good  Now, assign this commit id to good/bad commit id and follow the same steps from step2 till you find the culprit commit.  Please check the discussion at http://stackoverflow.com/questions/4713088/how-to-use-git-bisect
  • 8. THANK YOU  Have a look at My PPTs: www.slideshare.net/rampalliraj/ My Blog: http://practicepeople.blogspot.in/