Git Essentials

The Clearvision Git Essentials training course provides a comprehensive understanding of basic Git concepts and looks at the different ways Git can be used and implemented.

Audience:

This course is ideal for anyone new to Git version control, or anyone who has been using it for a while, without really understanding how it works.

Prerequisites:

  • Access to laptop
  • Internet connection

Objectives & Outcomes

Through the Clearvision Git Essentials course you’ll become an expert at using git for day to day development. Suitable for both new users and those who have been struggling for a while, we’ll show you how Git really works, not just the commands you’ll need but the impact you are having on both your local repository and the remote.

You’ll learn all about branches and strategy. You’ll work with the index to manipulate code in your local repository and perform merges while solving conflicts. Finally, you’ll dive deep into understanding git’s internal setup so collaborating with other users wont come as a surprise. You’ll be prepared for whatever your colleagues do next.

Course outline:

Module 1: Introduction

  • What this course covers
  • The need for Version Control
  • A brief history of git and what it is (i.e. a DVCS)
  • What is DVCS
  • Plumbing and Porcelain
  • The repository (at high level)
  • Getting Started

Lab Exercises

1. Group discussion, understanding DVCS

 

Module 2: Git Concepts

  • Git Object Types
    • Blobs
    • Trees
    • Commits
    • Tags
    • Git Reference Types
    • Object Model Example
  • Hash Values (SHA-1)
  • The Git Data Model

Lab Exercises

  • 1. Verify Git Installations
  • 2. Identify the git repository
  • 3. Ask Git for help

 

Module 3: Getting Started

  • How to create a new Git repository
  • Setting up Your Git Environment
  • Basic workflow
  • Adding new files
  • Changing existing files
  • Committing changes to the repository
  • The Git Log

Lab Exercises

  • 1. Identify yourself to Git
  • 2. Create a Git repository
  • 3. How to add new files/folders
  • 4. How to commit new files/folders
  • 5. Clone an existing repository
  • 6. Check the status of your Git repository

 

Module 4: Working with Git

  • Workflow
  • The Status command
  • Ignoring file types
    •  Negation in ignore files
  • View specific changes
  • Removing files & directories
  • Moving files & directories
  • Stashing Changes
  • Undoing or fixing errors
  • Reset a change
  • Revert a change
  • Checkout a change

Lab Exercises

  • 1. Use the git log command to help you clarify if you are committing the correct version of a file
  • 2. Use the git status command to help you clarify the current state of your repository

 

Module 5: Branching and Merging

  • What is a branch
  • Creating a branch
  • Switching between branches
  • What is a merge
  • Fast forward merge
  • 3-way merge
  • Resolving merge conflicts
  • Merge tools
  • Removing branches
  • Rebasing
    • autostash
  • Branch management in Git

Lab Exercises

  • 1. Create branches in Git
  • 2. Add files to branches
  • 3. Checkout branches
  • 4. Merge into branches
  • 5. Rebase and squash a feature branch

 

Module 6: Collaboration Basics

  • Cloning repositories
  • Remotes
  • Remote Branches and Tracking Branches
  • Fetching, Pulling and Pushing Changes
  • Bare and development repositories
  • Publishing repositories

Lab Exercises

  • 1. Clone a repository
  • 2. Create or Identify a remote
  • 3. Pull changes
  • 4. Push changes
  • 5. Merging between repositories

 

Module 7: Collaboration Stratagies

  • Branching Strategies
  • Structural Strategies

Lab Exercises

  • 1. A flexible exercise implementing the strategy you intend to use moving forward

 

Module 8: Tagging

  • What is a tag
  • Viewing tags
  • Creating tags
  • Signed tags
  • Tagging later
  • Sharing tags

Lab Exercises

  • 1. Create tags in Git
    • Lightweight tags
    • Annotated tags
    • Checkout tags in Git
  • 2. How to view tags
  • 3. How to checkout tags

 

Other relevant courses

1 days
Classroom Virtual
1 days
Classroom Virtual
1 days
Classroom Virtual