Mastering Git: A Beginner's Guide

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Mastering Git: A Beginner’s Guide introduces developers of all ages to the wonderful and useful world of Git.

As far as software development is considered, the advent of Git has truly proven to be a milestone. If you are a software developer, you have probably already heard of Git. Its importance and functionality in the world of coding merits very high praise for a variety of reasons.

Computers now have become very amenable machines. You can remove a significant section of the text from your work accidentally, but there is no need to panic. Simply use the Undo option and you’re good.

This, however, was not the case in the early days of development. Back then, developers did not have access to any such technology, and it was only one person who used to own the master copy of a work. This person would divide the code into specific parts, which would subsequently be divided between developers, who would work on their part and make their completed submissions independent of each other. This was followed by a standard check, after which the old version was completely replaced by the new version. This was a very tedious process―unless someone had beenvery proactive with making copies of the code, the previous versions of a file were often effectively lost.

Thankfully, a significant breakthrough came in 1972 when developer Marc Rochkind invented the Source Code Control System (SCCS), which was the very first form of Version Control System (VCS). It was limited in terms of its functionality, and could allow only one person to work on it at a time, while concurrent management had to be handled using locks. But we have come a long way since then.

Today, Git is the single most-used VCS out there. Its influence on coding and development, in particular, the innovative use of "branches" in order to facilitate collaboration for projects, cannot be over-emphasized. Version Control has become an indispensable part of our lives, and being familiar with the functioning of Git is something employers deem highly important.

Mastering Git will prove to be of tremendous help to developers of all spheres in learning Git and Version Control. This book offers information on a wide array of subjects pertaining to Git, and even briefly touches upon its history, advantages, and disadvantages. Mastering Git also offers tips on installation and different elements involved in its functioning, such as Repositories, Remotes, Aliases, Tagging, and Branches. Popular services and hosts for such Git projects as GitHub, GitLab, and Bitbucket are also discussed in detail. This book will prove to be a handy guide for both newbie learners and trained professionals.

Learn more about our other Mastering titles at:

https://www.routledge.com/Mastering-Computer-Science/book-series/MCS

Author(s): Sumanna Kaul, Shahryar Raz, Divya Sachdeva
Series: Mastering Computer Science
Publisher: CRC Press
Year: 2022

Language: English
Pages: 253
City: Boca Raton

Cover
Half Title
Series Page
Title Page
Copyright Page
Contents
About the Editor
CHAPTER 1: Getting Started
VERSION CONTROL BASICS
WHAT IS GIT?
ADVANTAGES OF GIT
For Development
Git for Marketing
Git for Product Management
Git for Designing
Git for Customer Support
Git for HR
Git for Budget Management
DISADVANTAGES OF GIT
HISTORY OF GIT
REFERENCES
CHAPTER 2: The Basics
INSTALLING GIT
FIRST TIME GIT SET UP
Establishing Your Identity
Editing
Default Branch Name
Check the Settings
Creating a New Repo
Git Clone
Saving Changes
Git Push
Bare and Cloned Repositories
Reverting Changes
TIPS AND TROUBLESHOOTING
CHAPTER 3: Working with Repositories
WHAT ARE GIT REPOSITORIES?
RECORDING CHANGES TO REPOS
WORKING WITH REMOTES
GIT ALIASES
TAGGING
How to List Your Tags?
Creating Tags
Annotated Tags
Lightweight Tags
Tagging Later
Sharing Tags
Deleting Tags
Check Out the Tags
Retagging or Replacing Old Tags
CHAPTER 4: Working with Branches
WHAT ARE BRANCHES?
Working
Common Commands
Creation of Branches
Creation of Remote Branches
Deleting Branches
BRANCHING AND MERGING
Definition of Git Branching
Branch Naming
BRANCH WORKFLOWS
How It Works
Beginning with the Main Branch
Creating a New Branch
Subsequent Tasks
Push Feature Branch to Remote
Resolve Feedback
Merge Your Pull Request
Pull Requests
REMOTE BRANCHES
Pushing
Tracking Branches
Pulling
Deleting the Remote Branches
CHAPTER 5: Working with Servers
GETTING GIT ON SERVER
Putting the Bare Repository on a Server
Small Setups
SSH Access
SERVER SETUP
DISTRIBUTED GIT AND PROJECTS
Distributed Workflow
Centralized Workflow
Integrator-Manager Workflow
Dictator and Lieutenants Workflow
Contributing to Projects
Commit Guidelines
CHAPTER 6: GitHub
WHAT IS GITHUB?
Account Set Up and Configuration
SSH Access
Your Avatar
Email Addresses
Two-Factor Authentication
HISTORY OF GITHUB
Acquired by Microsoft
Mascot
HOW TO USE GITHUB
How to Create a Repository on GitHub?
Create Branches
Making Commits
Pull Command
Merge Command
Cloning and Forking GitHub Repository
DIFFERENT TYPES OF ACCOUNTS
Personal User Accounts
Organization Accounts
Enterprise Accounts
CHAPTER 7: GitLab
WHAT IS GITLAB
HISTORY OF GITLAB
HOW TO USE GITLAB
GitLab and SSH Keys
Prerequisites
Supported SSH Key Types
Generating the SSH Keys
Configure Your SSH to Point to a Different Directory
Updating Your SSH Key Passphrase
Upgrade Your RSA Pair to a More Secure Format
Adding an SSH Key to Your GitLab Account
Verifying That You Can Connect
Using Different Keys for Different Repositories
Using Different Accounts on a Single GitLab Instance
Configure Two-Factor Authentication (2FA)
Using EGit on Eclipse
Use SSH on Microsoft Windows
Overriding SSH Settings on GitLab Server
Troubleshooting SSH Connections
Creating a Project
Creating a Group
Reserved Project and Group Names
How to Create a Branch
Feature Branch Workflow
Creating Forks
Adding a File to a Repository
Create a New Issue
Creating Merge Requests
From an Issue
When You Have to Add, Edit, or Upload a File
When You Create a Branch
When You Use Git Commands Locally
When You Have to Work in a Fork
By Sending an Email
Add Attachments When Creating Merge Request by Email
Set the Default Target Project
Working with Projects
Project Templates
Enterprise Templates
Custom Project Templates
Star a Project
Group Push Rules
Checking If Access Was Blocked Due to IP Restriction
FREE AND ENTERPRISE ACCOUNTS
CHAPTER 8: Bitbucket
WHAT IS BITBUCKET
Services
Bitbucket Cloud
Granting Repository Access to Users and Groups
Update User/Group Access
Branch Permissions
Suggesting or Requiring Checks before a Merge Takes Place
Using Pull Requests for Code Review
Pull Request Process
Pull Request Authors
Pull Request Reviewers
How to Restore a Deleted Branch
Bitbucket Server
HISTORY
FREE AND ENTERPRISE ACCOUNTS
Free
Standard
Premium
Overage Protection
Changing Your Plan
Updated Credit Card Details
See the Users on Your Plan
APPRAISAL
INDEX