Book Image

Version Control with Git and GitHub

By : Alex Magana, Joseph Muli
Book Image

Version Control with Git and GitHub

By: Alex Magana, Joseph Muli

Overview of this book

<p>Introduction to Git and GitHub begins with setting up and configuring Git on your computer along with creating a repository and using it for exercises throughout the book. With the help of multiple activities, you’ll learn concepts that show various stages of a file—from when it is untracked to when it is set for tracking under version control. As you make your way through the chapters, you’ll learn to navigate through the history of a repository, fetch and deliver code to GitHub, and undo code changes. </p><p> </p><p>The first half of the book ends with you learning to work with branches, storing and retrieving changes temporarily, and merging the desired changes into a repository. </p><p> </p><p>In the second half, you’ll learn about forking as part of a collaborative workflow. You’ll also address modularity and duplication through submodules, tracing and rectifying faulty changes, and maintaining repositories. </p><p> </p><p>By the end of this book, you will have learned how to effectively deploy applications using GitHub.</p>
Table of Contents (8 chapters)

About the Book

Version control refers to the tracking and traceability of changes. It is, in a way, akin to the use of a bookmark in a book, to mark the point the reader should return to when they resume reading. In version control, this metaphorical bookmark marks a reference to a snapshot of the code base. Git is a version control tool. Using Git, you can make, track, retrieve, and share changes on a repository. GitHub is a hosting service where a repository resides.

This book begins by providing you with a thorough understanding of what version control is, why it's necessary, and how it lends itself to application development and version management. With thorough explanations and interesting activities, you will learn all about using Git and GitHub optimally. By the end of the book, you will have the skills to safeguard your application and ensure its speedy development.

About the Authors

Alex Magana is a software engineer keen on developing solutions that matter. He is interested in HCI, machine learning, agritech, information storage and retrieval, and effective backup and recovery. Alex has helped to deliver projects for clients on context-aware and location-based services, point-of-sale software, data analytics for mobile-based banking, and AMP-based performant news pages across a myriad of locales. To let his hair down, Alex enjoys music, dance, adventure, reading, and exploring architecture. He is an avid gastronome at heart.

Joseph Muli loves programming, writing, teaching, gaming, and travelling. Currently, he is working as a software engineer at Andela and Fathom, specializing in DevOps and site reliability. Previously, he worked as a software engineer and technical mentor at Moringa School.

Objectives

  • Understand and implement best practices in version control
  • Explain the GitHub User Interface
  • Understand what the Feature-Branch Workflow is and implement its features.
  • Use forking features, such as submodules and rebasing
  • Master commands for debugging and maintaining a repository
  • Implement continuous integration with CircleCI
  • Gain insight into release management and how GitHub enables software releases

Audience

This book is meant for developers, who want to migrate from other version control tools, or want to learn more about Git. Prior experience in coding or familiarity with using the bash command-line interface will enable you to easily grasp the concepts introduced.

Approach

This book thoroughly explains the technology in an easy-to-understand language, while perfectly balancing theory and exercises. Each chapter is designed to build on the learnings of the previous chapter. The book also contains multiple activities that use real-life business scenarios for you to practice and apply your new skills in a highly relevant context.

Minimum Hardware Requirements

For the optimal student experience, we recommend the following hardware configuration:

  • Processor: Intel Core i3 or equivalent
  • Memory: 4 GB RAM
  • Storage: 35 GB available space
  • 5400 RPM hard disk drive
  • DirectX 9-compatible video card (1024 x 768 or higher resolution)
  • An internet connection

Software Requirements

You'll also need the following software installed in advance:

Installing the Code Bundle

Copy the code bundle for the class to the C:/Code folder.

Additional Resources

The code bundle for this book is also hosted on GitHub at: https://github.com/TrainingByPackt/Version-Control-with-Git-and-GitHub.

We also have other code bundles from our rich catalog of books and videos available at: https://github.com/PacktPublishing/. Check them out!

Conventions

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "On macOS, edit ~/.ssh/config to enable the ssh-agent to automatically load keys and store passphrases in the keychain."

A block of code is set as follows:

Host *
    AddKeysToAgent yes
    UseKeychain yes
    IdentityFile [location_of_the_generated_private_key]

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "A license governs the utilization of an application by its users..."

Installing Atom IDE

  1. To install Atom IDE, go to https://atom.io/ in your browser.
  2. Click on Download Windows Installer for Windows, to download the setup file called AtomSetup-x64.exe.
  3. Run the executable file.
  4. Add the atom and apm commands to you path.
  5. Create shortcuts on the desktop and start menu.

Installing Git

  1. To install Git via the package installer, go to https://git-scm.com/download/linux.
  2. Run the following command: # apt-get install git on the terminal window.
  3. Enter your password if prompted.