SlideShare une entreprise Scribd logo
1  sur  61
G it’s the way
   to do it!
G it’s the way
           to do it!




 A Beginnerʼs Guide to
Version Control with Git.
What is
Version Control?
What is
      Version Control?
• Allows you to keep a history of every change
  within a project.
What is
      Version Control?
• Allows you to keep a history of every change
  within a project.
• Allows multiple people to collaborate on the
  same project, without evil stuff happening.
What is
        Version Control?
• Allows you to keep a history of every change
    within a project.
• Allows multiple people to collaborate on the
    same project, without evil stuff happening.
•   All files (and historical versions) are backed-
    up automatically.
What is Git?
What is Git?


• Created by Linus Torvalds.
What is Git?


• Created by Linus Torvalds.
• Run locally, with no server needed.
What is Git?


• Created by Linus Torvalds.
• Run locally, with no server needed.
• Works offline.
What is Git?


• Created by Linus Torvalds.
• Run locally, with no server needed.
• Works offline.
• Command-line or GUI.
Installation
Installation

• Windows:
  http://code.google.com/p/msysgit/
• Mac OSX:
  http://code.google.com/p/git-osx-installer/
• Linux:
  Packages available for most distros, or build from
  source.
Configuring Git

• Configure your name and email address.
  git config --global user.name = ‘leeky’

  git config --global user.email = ‘leeky@leeky.org.uk’



• Using ‘--global’ makes these the default value
  for all projects.
Starting a New
Git-Managed Project
Starting a New
   Git-Managed Project

• Create directory for project.
Starting a New
    Git-Managed Project

• Create directory for project.
•   cd   into project directory.
Starting a New
    Git-Managed Project

• Create directory for project.
•   cd   into project directory.

• Type git init to initialise Git for this
    project.
Starting a New
     Git-Managed Project

• Create directory for project.
•   cd   into project directory.

• Type git init to initialise Git for this
    project.
    Initialized empty Git repository in /git/demo/.git/
Terminology

• Repository - where the current and historical
  file data is stored.
• Working copy - the local copy of files from a
  repository, at a specific time or revision.
• Commit - copy files from your working copy to
  the repository.These changes are stored together
  as an individual revision.
Basic Git Workflow
1. Add, edit and delete files in your project in
   the normal way, using your favourite editor
   (e.g. TextMate,Vi, Dreamweaver etc).
2. Tell Git which file(s) are to be saved into the
   new commit using git add
3. Commit files to repository using git   commit.
Demo
Git Commands

•   git status   - View status of working copy.
•   git add   - Add unstaged changes.
    - git   add {filename} {filename} ...
    - git   add .

• git commit     - Commit changes to repository.
    - git   commit -m “{message}”
More Git Commands

•   git diff- Shows differences between
    working copy and last revision.
•   git log    - Shows the history log.
    - git   log {filename}   - Restrict log to file(s)
• git blame {filename}   - Shows when/who
    made changes to a file.
Git GUI




• Launch by running git gui in your project’s
  directory.
• Gives you ability to add files and create
  commits without using the command line!
Gitk




• Launch by running gitk in your project’s
  directory.
• Allows you to browse the entire history of
  your project and see when and by whom
  files were changed.
Gitk




• Launch by running gitk in your project’s
  directory.
• Allows you to browse the entire history of
  your project and see when and by whom
  files were changed.
TextMate
TextMate




    Git Bundle                    ProjectPlus
http://www.gitorious.org/     http://www.ciaranwal.sh/
  projects/git-tmbundle     2008/08/05/textmate-plug-in-
                                     projectplus
Branching
Branching

• Allows experimental features to be
  developed separately, without affecting stable
  code.
Branching

• Allows experimental features to be
  developed separately, without affecting stable
  code.
• Branches can be easily created and later
  merged together.
Branching

• Allows experimental features to be
   developed separately, without affecting stable
   code.
• Branches can be easily created and later
   merged together.

Master     Master
Branching

• Allows experimental features to be
   developed separately, without affecting stable
   code.
• Branches can be easily created and later
   merged together.

Master     Master

            git branch   Branch   Branch
Branching

• Allows experimental features to be
   developed separately, without affecting stable
   code.
• Branches can be easily created and later
   merged together.

Master     Master        Master   Master

            git branch   Branch   Branch
Branching

• Allows experimental features to be
   developed separately, without affecting stable
   code.
• Branches can be easily created and later
   merged together.

Master     Master        Master   Master      Master

            git branch   Branch   Branch   git merge
Working with Branches
Working with Branches
•   git branch

    - git   branch   - View branches.
    - git   branch   {branchname} - Create a new
      branch.
Working with Branches
•   git branch

    - git   branch   - View branches.
    - git   branch   {branchname} - Create a new
      branch.
•   git checkout {branchname}     - Switch to
    another branch.
Working with Branches
•   git branch

    - git   branch   - View branches.
    - git   branch   {branchname} - Create a new
      branch.
•   git checkout {branchname}     - Switch to
    another branch.
• git checkout -b {branchname}   - Create new
    branch and immediately switch to it.
Merging Branches
Merging Branches


Merge otherbranch into mainbranch:
Merging Branches


Merge otherbranch into mainbranch:
•   git checkout {mainbranch}
Merging Branches


Merge otherbranch into mainbranch:
•   git checkout {mainbranch}

•   git merge {otherbranch}
Merging Branches


Merge otherbranch into mainbranch:
•   git checkout {mainbranch}

•   git merge {otherbranch}

•   git merge {otherbranch} -m “commit msg”
Conflict Resolution
Conflict Resolution

CONFLICT (add/add): Merge conflict in foo

Automatic merge failed; fix conflicts and
then commit the result.
Conflict Resolution



     D O N ʼT
CONFLICT (add/add): Merge conflict in foo




          IC  !
Automatic merge failed; fix conflicts and
then commit the result.


        N
     PA
Conflict Resolution

# On branch master
# Your branch and 'origin/master' have   diverged,
# and have 1 and 1 different commit(s)   each, respectively.
#
# Changed but not updated:
#   (use "git add <file>..." to update   what will be committed)
#
#	 unmerged:   foo
# no changes added to commit (use "git   add" and/or "git commit -a")
Conflict Resolution
la la la
<<<<<<< HEAD:foo
wish


dog
cow
cat
=======
moo cow

fish

>>>>>>> 0cb13d1ceabf7e579b423815d8314fca0475ab7f:foo
Conflict Resolution



• Merge manually.
• Commit the merge.
Collaborating with Others
Collaborating with Others

Clone an existing repository:
•   git clone {anotherpath} {directory}

•   git clone {url} {directory}

Manage connections to remote repositories:
•   git remote

    -    git remote add {name} {url}
Pushing & Pulling
Pushing & Pulling
Pull (download) from another repository:
•   git pull {remotename} {remotebranch}

•   git pull
Pushing & Pulling
Pull (download) from another repository:
•   git pull {remotename} {remotebranch}

•   git pull



Push (upload) to another repository:
•   git push {remotename} {remotebranch}

•   git push
Third-party Git Hosts


• GitHub - http://www.github.com
• Gitorious - http://www.gitorious.org/
• Unfuddle - http://www.unfuddle.com
GitHub Demo
Resources

• Git for Designers -
  http://hoth.entp.com/output/git_for_designers.html
• Peepcode Screencast ($9) -
  https://peepcode.com/products/git
• Hosting your own repositories -
  http://scie.nti.st/2007/11/14/hosting-git-
  repositories-the-easy-and-secure-way
Thanks for listening.
     Robert Lee-Cann
      Lee-Cann Creative

      hello@lee-cann.com

Contenu connexe

Tendances

Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagramsDilum Navanjana
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesBrent Laster
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 
Intro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostIntro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostAndrew Kerr
 
GIT presentation
GIT presentationGIT presentation
GIT presentationNaim Latifi
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for DocumentationAnne Gentle
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitLukas Fittl
 

Tendances (20)

Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and Features
 
Intro to Git & GitHub
Intro to Git & GitHubIntro to Git & GitHub
Intro to Git & GitHub
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Github
GithubGithub
Github
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
Intro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostIntro to Git, GitHub, and Devpost
Intro to Git, GitHub, and Devpost
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
 

En vedette

Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part ISergey Aganezov
 
01 - Introduction to Version Control
01 - Introduction to Version Control01 - Introduction to Version Control
01 - Introduction to Version ControlSergii Shmarkatiuk
 
Joget Workflow v5 Training Slides - Module 12 - Version Control
Joget Workflow v5 Training Slides - Module 12 - Version ControlJoget Workflow v5 Training Slides - Module 12 - Version Control
Joget Workflow v5 Training Slides - Module 12 - Version ControlJoget Workflow
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systemsTim Staley
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 
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
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control SystemKMS Technology
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitLuigi De Russis
 

En vedette (14)

Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Introduzione a Git
Introduzione a GitIntroduzione a Git
Introduzione a Git
 
Version control
Version controlVersion control
Version control
 
01 - Introduction to Version Control
01 - Introduction to Version Control01 - Introduction to Version Control
01 - Introduction to Version Control
 
Joget Workflow v5 Training Slides - Module 12 - Version Control
Joget Workflow v5 Training Slides - Module 12 - Version ControlJoget Workflow v5 Training Slides - Module 12 - Version Control
Joget Workflow v5 Training Slides - Module 12 - Version Control
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systems
 
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
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Git basics
Git basicsGit basics
Git basics
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 

Similaire à Beginner's Guide to Version Control with Git

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsGorav Singal
 

Similaire à Beginner's Guide to Version Control with Git (20)

Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
git-presentation.pdf
git-presentation.pdfgit-presentation.pdf
git-presentation.pdf
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
3 Git
3 Git3 Git
3 Git
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
git and github
git and githubgit and github
git and github
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git 101
Git 101Git 101
Git 101
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 

Dernier

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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 slidevu2urc
 
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 WorkerThousandEyes
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Dernier (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Beginner's Guide to Version Control with Git

  • 1.
  • 2. G it’s the way to do it!
  • 3. G it’s the way to do it! A Beginnerʼs Guide to Version Control with Git.
  • 5. What is Version Control? • Allows you to keep a history of every change within a project.
  • 6. What is Version Control? • Allows you to keep a history of every change within a project. • Allows multiple people to collaborate on the same project, without evil stuff happening.
  • 7. What is Version Control? • Allows you to keep a history of every change within a project. • Allows multiple people to collaborate on the same project, without evil stuff happening. • All files (and historical versions) are backed- up automatically.
  • 9. What is Git? • Created by Linus Torvalds.
  • 10. What is Git? • Created by Linus Torvalds. • Run locally, with no server needed.
  • 11. What is Git? • Created by Linus Torvalds. • Run locally, with no server needed. • Works offline.
  • 12. What is Git? • Created by Linus Torvalds. • Run locally, with no server needed. • Works offline. • Command-line or GUI.
  • 14. Installation • Windows: http://code.google.com/p/msysgit/ • Mac OSX: http://code.google.com/p/git-osx-installer/ • Linux: Packages available for most distros, or build from source.
  • 15. Configuring Git • Configure your name and email address. git config --global user.name = ‘leeky’ git config --global user.email = ‘leeky@leeky.org.uk’ • Using ‘--global’ makes these the default value for all projects.
  • 17. Starting a New Git-Managed Project • Create directory for project.
  • 18. Starting a New Git-Managed Project • Create directory for project. • cd into project directory.
  • 19. Starting a New Git-Managed Project • Create directory for project. • cd into project directory. • Type git init to initialise Git for this project.
  • 20. Starting a New Git-Managed Project • Create directory for project. • cd into project directory. • Type git init to initialise Git for this project. Initialized empty Git repository in /git/demo/.git/
  • 21. Terminology • Repository - where the current and historical file data is stored. • Working copy - the local copy of files from a repository, at a specific time or revision. • Commit - copy files from your working copy to the repository.These changes are stored together as an individual revision.
  • 22. Basic Git Workflow 1. Add, edit and delete files in your project in the normal way, using your favourite editor (e.g. TextMate,Vi, Dreamweaver etc). 2. Tell Git which file(s) are to be saved into the new commit using git add 3. Commit files to repository using git commit.
  • 23. Demo
  • 24. Git Commands • git status - View status of working copy. • git add - Add unstaged changes. - git add {filename} {filename} ... - git add . • git commit - Commit changes to repository. - git commit -m “{message}”
  • 25. More Git Commands • git diff- Shows differences between working copy and last revision. • git log - Shows the history log. - git log {filename} - Restrict log to file(s) • git blame {filename} - Shows when/who made changes to a file.
  • 26. Git GUI • Launch by running git gui in your project’s directory. • Gives you ability to add files and create commits without using the command line!
  • 27. Gitk • Launch by running gitk in your project’s directory. • Allows you to browse the entire history of your project and see when and by whom files were changed.
  • 28. Gitk • Launch by running gitk in your project’s directory. • Allows you to browse the entire history of your project and see when and by whom files were changed.
  • 30. TextMate Git Bundle ProjectPlus http://www.gitorious.org/ http://www.ciaranwal.sh/ projects/git-tmbundle 2008/08/05/textmate-plug-in- projectplus
  • 32. Branching • Allows experimental features to be developed separately, without affecting stable code.
  • 33. Branching • Allows experimental features to be developed separately, without affecting stable code. • Branches can be easily created and later merged together.
  • 34. Branching • Allows experimental features to be developed separately, without affecting stable code. • Branches can be easily created and later merged together. Master Master
  • 35. Branching • Allows experimental features to be developed separately, without affecting stable code. • Branches can be easily created and later merged together. Master Master git branch Branch Branch
  • 36. Branching • Allows experimental features to be developed separately, without affecting stable code. • Branches can be easily created and later merged together. Master Master Master Master git branch Branch Branch
  • 37. Branching • Allows experimental features to be developed separately, without affecting stable code. • Branches can be easily created and later merged together. Master Master Master Master Master git branch Branch Branch git merge
  • 39. Working with Branches • git branch - git branch - View branches. - git branch {branchname} - Create a new branch.
  • 40. Working with Branches • git branch - git branch - View branches. - git branch {branchname} - Create a new branch. • git checkout {branchname} - Switch to another branch.
  • 41. Working with Branches • git branch - git branch - View branches. - git branch {branchname} - Create a new branch. • git checkout {branchname} - Switch to another branch. • git checkout -b {branchname} - Create new branch and immediately switch to it.
  • 44. Merging Branches Merge otherbranch into mainbranch: • git checkout {mainbranch}
  • 45. Merging Branches Merge otherbranch into mainbranch: • git checkout {mainbranch} • git merge {otherbranch}
  • 46. Merging Branches Merge otherbranch into mainbranch: • git checkout {mainbranch} • git merge {otherbranch} • git merge {otherbranch} -m “commit msg”
  • 48. Conflict Resolution CONFLICT (add/add): Merge conflict in foo Automatic merge failed; fix conflicts and then commit the result.
  • 49. Conflict Resolution D O N ʼT CONFLICT (add/add): Merge conflict in foo IC ! Automatic merge failed; fix conflicts and then commit the result. N PA
  • 50. Conflict Resolution # On branch master # Your branch and 'origin/master' have diverged, # and have 1 and 1 different commit(s) each, respectively. # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # # unmerged: foo # no changes added to commit (use "git add" and/or "git commit -a")
  • 51. Conflict Resolution la la la <<<<<<< HEAD:foo wish dog cow cat ======= moo cow fish >>>>>>> 0cb13d1ceabf7e579b423815d8314fca0475ab7f:foo
  • 52. Conflict Resolution • Merge manually. • Commit the merge.
  • 54. Collaborating with Others Clone an existing repository: • git clone {anotherpath} {directory} • git clone {url} {directory} Manage connections to remote repositories: • git remote - git remote add {name} {url}
  • 56. Pushing & Pulling Pull (download) from another repository: • git pull {remotename} {remotebranch} • git pull
  • 57. Pushing & Pulling Pull (download) from another repository: • git pull {remotename} {remotebranch} • git pull Push (upload) to another repository: • git push {remotename} {remotebranch} • git push
  • 58. Third-party Git Hosts • GitHub - http://www.github.com • Gitorious - http://www.gitorious.org/ • Unfuddle - http://www.unfuddle.com
  • 60. Resources • Git for Designers - http://hoth.entp.com/output/git_for_designers.html • Peepcode Screencast ($9) - https://peepcode.com/products/git • Hosting your own repositories - http://scie.nti.st/2007/11/14/hosting-git- repositories-the-easy-and-secure-way
  • 61. Thanks for listening. Robert Lee-Cann Lee-Cann Creative hello@lee-cann.com

Notes de l'éditeur

  1. Hello, my name is Robert Lee-Cann and I&amp;#x2019;m a web developer. In this talk I&amp;#x2019;ll be introducing you to the basic concepts of version control - what it is, how it works and the benefits it will bring to your development workflow.
  2. Hello, my name is Robert Lee-Cann and I&amp;#x2019;m a web developer. In this talk I&amp;#x2019;ll be introducing you to the basic concepts of version control - what it is, how it works and the benefits it will bring to your development workflow.
  3. So what exactly IS version control?
  4. So what exactly IS version control?
  5. So what exactly IS version control?