Course Code: gitbasicbesp
Duration: 7 hours
Prerequisites:

This course is ideal for anyone new to Git version control, or anyone who is familiar with Git but could do with a stronger understanding.

  • Basic knowledge of Linux interfaces (including Linux/UNIX command line interface)
  • No previous Git experience is required
Overview:

With this Git Basics course, you’ll become an expert at using Git for day-to-day development. 

The instructor will show you how Git really works, not just the commands you’ll need but the impact on both your local and remote repository.

You’ll learn about branches and strategy and work with the index to manipulate code in your local repository and perform merges while solving conflicts. Finally, you’ll dive deep into Git’s internal set up so that collaborating with other users won’t come as a surprise, preparing you for whatever your colleagues do next.

Course Outline:

Module 1: Introduction

  • Overview
  • The need for version control
  • A brief history of Git and what it is (i.e. a DVCS)
  • Defining a DVCS
  • Plumbing and porcelain
  • The repository (at high-level)
  • Getting Started

Lab 1 Exercises

  • 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 2 Exercises

  • Verify Git installations
  • Identify the Git repository
  • 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 3 Exercises

  • Identify yourself to Git
  • Create a Git repository
  • How to add new files/folders
  • How to commit new files/folders
  • Clone an existing repository
  • 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 and directories
  • Moving files and directories
  • Stashing changes
  • Undoing or fixing errors
  • Reset a change
  • Revert a change
  • Checkout a change

Lab 4 Exercises

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

Module 5: Branching and merging

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

Lab 5 Exercises

  • Create branches in Git
  • Add files to branches
  • Checkout branches
  • Merge into branches
  • 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 6 Exercises

  • Clone a repository
  • Create or identify a remote
  • Pull changes
  • Push changes
  • Merging between repositories

Module 7: Collaboration strategies

  • Branching strategies
  • Structural strategies

Lab 7 Exercises

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

Module 8: Tagging

  • Defining a tag
  • Viewing tags
  • Creating tags
  • Signed tags
  • Tagging later
  • Sharing tags

Lab 8 Exercises

  • Create tags in Git
  • Lightweight tags
  • Annotated tags
  • Checkout tags in Git
  • How to view tags
  • How to checkout tags