SlideShare ist ein Scribd-Unternehmen logo
1 von 29
GIT Fundamentals & Features
Presenter: Naincy Gupta
Mindfire Solutions
About Me
Certifications:
M70 101 - Magento Certified Developer
OCA 870 - MYSQL
Contact Me:
Email: naincy.gupta@mindfiresolutions.com
Skype: mfsi_naincy.gupta
Connect Me: -
Facebook : https://www.facebook.com/naincy.gupta.35574
LinkedIn : in.linkedin.com/pub/naincy-gupta/66/440/6a3/
Google+: https://plus.google.com/u/0/+NaincyGuptaTechSharing/posts
Blog: http://naincygupta@wordpress.com
Contents
 GIT
 Types of VCS
 Basic Fundamentals
 GIT Usage
 Workflows of GIT
 GIT Stash
 Code Quality
 Why GIT make you happy?
 Git is nothing but a SCM tool.
 Git is a free and open source distributed version control system
designed to handle everything from small to very large projects
with speed and efficiency.
 Git is easy to learn and has a tiny footprint with lightning fast
performance.
Centralized Distributed
Central, authoritative repository Everyone has its own repository
All changes saved in one single location Get safety without having worry about
'breaking the build'
Client-Server approach One can change in repository and those
changes will be local to them unless they
synchronize with someone else.
Is this true?
Start with GIT
 Install GIT client
- sudo apt-get install git (linux)
- brew install git (MAC)
 Check if git is installed or not
$ git –version
 Set username and email to your git config
$ git config --global user.name “Naincy”
$ git config --global user.email “nansee1804@gmail.com”
$ git config –list (will allow you to verify the username and email)
GIT Fundamentals
Creating a repository (if it does not exist remotely)
$ git init (follow http://git-scm.com/docs/git-init for more information)
Cloning a remote repository:
$ git clone http[s]://host.xz[:port]/path/to/repo.git/
(Inspecting a repo: $ vim .git/config)
Inspecting repo:
$ git status [Difference b/w index file and current head commit]
$ git log [Sow list of all commit with commit message]
$ git log -1 [Show top 1st commit]
$ git log - -pretty=oneline [Show list of all commit in single line]
Branch Operations:
$ git branch <branch_name> OR git checkout -b <branch_name> [will
create new branch for you]
$ git branch -D <bramch_name> [allows you to delete branch]
$ git branch -m <old_branch_name> <new_branch_name> [will remane the
branch name from old to new]
$ git checkout <branch_name> [allows to switch to other branch]
$ git log - -pretty=oneline [Show list of all commit in single line]
Making edit and commiting
$ git diff [will show delta difference code of current master HEAD and current index]
$ git status [will show path of file as “Changes not staged for commit”]
$ git add (-A) [will show file as “Changes to be commited”]
$ git commit -m [write your commit message. Save and exit] {file changed, insertion, deletion}
Check your commit by $ git log
Send changes to server
$ git push <branch_name> [will push your all local changes to the server]
$ git pull <branch_name> [will pull all changes from server to your local]
Recover your changes that you have added by mistakes
$ git add <file name> [file <file name> that you have added by mistake]
$ git status
$ git reset HEAD <filename>
$ git checkout - - <filename>
Merge one branch to another
$ git merge branch2 [you are in branch 1 and merging branch2]
If you get conflicts, then can resolve with mergetool which provides a GUI interface to resolve conflicts.
$ git mergetool
GIT WorkFlows
GIT Stash
Will allow you to save your changes without commiting them
$ git stash save 'message' [save your change as a seperte stash@{*} branch with
commit message]
$ git stash list [will show you list of all stash with commit message]
$ git show <stash@{0}>
[will show you what code difference contain this this stash@{0}]
$ git apply <stash@{0}> [will allow to apply change in current branch]
Code Quality
 Fast and Compact
 Freedom and Safety
 Explore and Understand
 Control and Assemble
 Enforce Discipline: manages process by which control of items
passes from one another.
 Archive Version: can store subsequent versions of source
control items. Also maintain lot of historical data like author,
date, time, etc.
 Enable Collaboration: easy sharing of files and docs
 Recover from accidental deletion: can easily swith to
working copy.
QUESTIONS..??
Mail me your questions at nansee1804@gmail.com
Thank You..!!

Weitere ähnliche Inhalte

Was ist angesagt?

Git Introductive
Git IntroductiveGit Introductive
Git Introductive
Adham Saad
 

Was ist angesagt? (20)

Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git learning
Git learningGit learning
Git learning
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Git basics
Git basicsGit basics
Git basics
 
Git 101
Git 101Git 101
Git 101
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git: basic to advanced
Git: basic to advancedGit: basic to advanced
Git: basic to advanced
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 

Andere mochten auch

Experince latter1
Experince  latter1Experince  latter1
Experince latter1
Ummar Ahmad
 
Projet Bd
Projet BdProjet Bd
Projet Bd
sebT4
 
Proyecto de vida coe
Proyecto de vida coeProyecto de vida coe
Proyecto de vida coe
sanje3112
 

Andere mochten auch (17)

RestFul Api documentation with Swagger
RestFul Api documentation with SwaggerRestFul Api documentation with Swagger
RestFul Api documentation with Swagger
 
Sunny Side Up 3
Sunny Side Up 3Sunny Side Up 3
Sunny Side Up 3
 
Experince latter1
Experince  latter1Experince  latter1
Experince latter1
 
Projet Bd
Projet BdProjet Bd
Projet Bd
 
CRUCIGRAMA
CRUCIGRAMA CRUCIGRAMA
CRUCIGRAMA
 
Answer garden
Answer gardenAnswer garden
Answer garden
 
2016 resume
2016 resume2016 resume
2016 resume
 
Come ti riciclo
Come ti ricicloCome ti riciclo
Come ti riciclo
 
Presentación1
Presentación1Presentación1
Presentación1
 
DEGREE
DEGREEDEGREE
DEGREE
 
Distributors Action plan
Distributors Action planDistributors Action plan
Distributors Action plan
 
Habilidades y valores plan de vida y carrera TecM
Habilidades y valores plan de vida y carrera TecMHabilidades y valores plan de vida y carrera TecM
Habilidades y valores plan de vida y carrera TecM
 
SMART TOOLS: DISSECT, DIGEST AND DELIVER BIG DATA from Structure:Data 2012
SMART TOOLS: DISSECT, DIGEST AND DELIVER BIG DATA from Structure:Data 2012SMART TOOLS: DISSECT, DIGEST AND DELIVER BIG DATA from Structure:Data 2012
SMART TOOLS: DISSECT, DIGEST AND DELIVER BIG DATA from Structure:Data 2012
 
ICT Presentation
ICT PresentationICT Presentation
ICT Presentation
 
Guerra fría crisis en berlin
Guerra fría crisis en berlinGuerra fría crisis en berlin
Guerra fría crisis en berlin
 
Material y suturas quirúrgicas
Material y suturas quirúrgicasMaterial y suturas quirúrgicas
Material y suturas quirúrgicas
 
Proyecto de vida coe
Proyecto de vida coeProyecto de vida coe
Proyecto de vida coe
 

Ähnlich wie Git and fundamentals

Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
King Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
King Hom
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
King Hom
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
Abdul Basit
 

Ähnlich wie Git and fundamentals (20)

Git github
Git githubGit github
Git github
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
 
Git 101
Git 101Git 101
Git 101
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
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
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
Git introduction
Git introductionGit introduction
Git introduction
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git
GitGit
Git
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 

Git and fundamentals

  • 1. GIT Fundamentals & Features Presenter: Naincy Gupta Mindfire Solutions
  • 2. About Me Certifications: M70 101 - Magento Certified Developer OCA 870 - MYSQL Contact Me: Email: naincy.gupta@mindfiresolutions.com Skype: mfsi_naincy.gupta Connect Me: - Facebook : https://www.facebook.com/naincy.gupta.35574 LinkedIn : in.linkedin.com/pub/naincy-gupta/66/440/6a3/ Google+: https://plus.google.com/u/0/+NaincyGuptaTechSharing/posts Blog: http://naincygupta@wordpress.com
  • 3. Contents  GIT  Types of VCS  Basic Fundamentals  GIT Usage  Workflows of GIT  GIT Stash  Code Quality  Why GIT make you happy?
  • 4.  Git is nothing but a SCM tool.  Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.  Git is easy to learn and has a tiny footprint with lightning fast performance.
  • 5.
  • 6.
  • 7. Centralized Distributed Central, authoritative repository Everyone has its own repository All changes saved in one single location Get safety without having worry about 'breaking the build' Client-Server approach One can change in repository and those changes will be local to them unless they synchronize with someone else.
  • 9.
  • 10. Start with GIT  Install GIT client - sudo apt-get install git (linux) - brew install git (MAC)  Check if git is installed or not $ git –version  Set username and email to your git config $ git config --global user.name “Naincy” $ git config --global user.email “nansee1804@gmail.com” $ git config –list (will allow you to verify the username and email)
  • 11. GIT Fundamentals Creating a repository (if it does not exist remotely) $ git init (follow http://git-scm.com/docs/git-init for more information) Cloning a remote repository: $ git clone http[s]://host.xz[:port]/path/to/repo.git/ (Inspecting a repo: $ vim .git/config)
  • 12. Inspecting repo: $ git status [Difference b/w index file and current head commit] $ git log [Sow list of all commit with commit message] $ git log -1 [Show top 1st commit] $ git log - -pretty=oneline [Show list of all commit in single line]
  • 13. Branch Operations: $ git branch <branch_name> OR git checkout -b <branch_name> [will create new branch for you] $ git branch -D <bramch_name> [allows you to delete branch] $ git branch -m <old_branch_name> <new_branch_name> [will remane the branch name from old to new] $ git checkout <branch_name> [allows to switch to other branch] $ git log - -pretty=oneline [Show list of all commit in single line]
  • 14. Making edit and commiting $ git diff [will show delta difference code of current master HEAD and current index] $ git status [will show path of file as “Changes not staged for commit”] $ git add (-A) [will show file as “Changes to be commited”] $ git commit -m [write your commit message. Save and exit] {file changed, insertion, deletion} Check your commit by $ git log Send changes to server $ git push <branch_name> [will push your all local changes to the server] $ git pull <branch_name> [will pull all changes from server to your local]
  • 15.
  • 16. Recover your changes that you have added by mistakes $ git add <file name> [file <file name> that you have added by mistake] $ git status $ git reset HEAD <filename> $ git checkout - - <filename> Merge one branch to another $ git merge branch2 [you are in branch 1 and merging branch2] If you get conflicts, then can resolve with mergetool which provides a GUI interface to resolve conflicts. $ git mergetool
  • 18.
  • 19.
  • 20.
  • 21. GIT Stash Will allow you to save your changes without commiting them $ git stash save 'message' [save your change as a seperte stash@{*} branch with commit message] $ git stash list [will show you list of all stash with commit message] $ git show <stash@{0}> [will show you what code difference contain this this stash@{0}] $ git apply <stash@{0}> [will allow to apply change in current branch]
  • 23.
  • 24.
  • 25.
  • 26.  Fast and Compact  Freedom and Safety  Explore and Understand  Control and Assemble  Enforce Discipline: manages process by which control of items passes from one another.  Archive Version: can store subsequent versions of source control items. Also maintain lot of historical data like author, date, time, etc.  Enable Collaboration: easy sharing of files and docs  Recover from accidental deletion: can easily swith to working copy.
  • 27.
  • 28. QUESTIONS..?? Mail me your questions at nansee1804@gmail.com