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.
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.
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.
By the end of this book, you will have learned how to effectively deploy applications using GitHub.
Author(s): Alex Magana, Joseph Muli
Publisher: Packt Publishing
Year: 2018
Language: English
Pages: 344
Tags: GitHub
Preface......Page 11
Introducing Version Control......Page 17
Defining Version Control......Page 18
Common Terminologies......Page 20
Forking Workflow......Page 22
Exercise 1: Setting Up a GitHub Account......Page 23
Exercise 2: Utilizing Two-Factor Authentication......Page 28
Organizations......Page 31
Exercise 3: Setting Up an Organization......Page 32
Exercise 4: Setting Up a Team......Page 34
Exercise 5: Setting Up Codacy for Accounts......Page 36
Runtime Config......Page 39
Exercise 6: Setting User Credentials......Page 40
Removing Configuration......Page 41
Exercise 7: Setting Up SSH......Page 42
Exercise 8: Creating a Repository in a Local Environment......Page 46
Exercise 9: Creating a Repository on GitHub......Page 51
Exercise 10: Adding and Deleting Contributors......Page 54
Navigating Branches, Commits, and Insights (Contributors, Pulse, Forks)......Page 57
GitHub Etiquette......Page 58
Repository Names, Tags, and Descriptions......Page 59
Wikis and Issues......Page 64
Activity 1: Creating a Repository......Page 68
Summary......Page 70
Versioning Commits......Page 73
Introduction to Versioning Commits......Page 74
Exercise 12: Viewing and Establishing the Status of a File......Page 75
Comparing the Working Tree to the Index......Page 79
Comparing the Index to an Arbitrary Commit......Page 80
Comparing Commits and Branches ......Page 81
Exercise 13: Examining Differences Between Files......Page 82
Exercise 14: Adding Files to the Index......Page 89
Exercise 15: Removing Files from the Working Tree and the Index......Page 96
Exercise 16: Moving and Renaming Files......Page 98
History and Logs......Page 100
Amending a Single Most Recent Commit......Page 112
Exercise 17: Editing the Most Recent Commit......Page 113
Amending Multiple Commits......Page 114
Exercise 18: Editing Commits Using the reword Command......Page 115
Exercise 19: Editing Commits Using the edit Command......Page 117
Activity 2: Tracking Files......Page 120
Summary......Page 122
Fetching and Delivering Code......Page 125
Fetching the Code......Page 126
Exercise 20: Configuring the Remote Repository......Page 127
Default and Protected Branches......Page 130
Exercise 21: Configuring the Base Branch and Branch Protection......Page 131
Fetching, Pushing, and Pulling Changes......Page 134
Exercise 22: Retrieving Changes......Page 136
Dealing with Non-Fast-Forward Commits......Page 140
Exercise 23: Reversing Changes......Page 142
Other Possible Uses......Page 146
Activity 3: Handling Changes and Enforcing Branch Restrictions......Page 151
Summary......Page 153
Branches......Page 155
Utilizing Workflows......Page 156
Feature-Branch Workflow......Page 157
Exercise 24: Feature-Branch Workflow-Driven Delivery......Page 159
Creating, Renaming, Deleting, and Listing Branches......Page 169
Creating:......Page 170
Merging......Page 174
Cherry-Pick......Page 176
Exercise 25: Examining Branch Differences......Page 178
Exercise 26: Standardizing Procedures through Ordered Templates......Page 181
Identifying and Fixing Merge Issues......Page 187
Exercise 27: Merge Conflict Resolution......Page 189
Exercise 28: Resolving Conflicts......Page 193
Merging and Reverting Pull Requests......Page 196
Exercise 29: Pull Request Reversal......Page 199
Activity 4: Managing Branches and Experimentation with Selective Changes......Page 202
Summary......Page 204
Collaborative Git......Page 207
Exercise 30: Forking a Repository......Page 208
Why Do We Fork Repositories?......Page 210
Embedding Upstream Changes......Page 211
Exercise 31: Modifying the Upstream Repository Remote Address......Page 213
Rebasing......Page 220
Exercise 32: Rebasing in GitHub......Page 222
Fixup and Squash Commits......Page 226
Exercise 33: Utilizing the Autosquash Feature......Page 227
Drop Commits......Page 230
Exercise 34: Dropping Commits......Page 232
Submodules......Page 234
Exercise 35: Utilizing Gitmodules......Page 235
_1ksv4uv......Page 239
Debugging and Maintenance......Page 240
Exercise 36: Identifying Revisions Using Git Blame......Page 241
Exercise 37: Finding Commits using Git Bisect......Page 244
Exercise 38: Removing Untracked Files using Git Clean......Page 249
Removing Merged Local and Remote Branches......Page 252
Exercise 39: Deleting Branches......Page 253
Activity 6: Utilizing Pre-Commit Hooks for Housekeeping......Page 254
Summary......Page 255
Automated Testing and Release Management......Page 257
Webhooks and GitHub Applications......Page 258
Exercise 40: Setting up a Webhook......Page 259
Exercise 41: Setting Up CircleCi CI......Page 262
Automated Pull Requests......Page 269
Exercise 42: Utilizing Automated Pull Requests......Page 270
Activity 7: Integrating a Build Pipeline on CircleCi......Page 272
Release Management......Page 273
Tagging......Page 274
Exercise 43: Creating Tags......Page 275
Exercise 44: Publishing GitHub Releases......Page 280
Exercise 45: Packaging through GitHub Archive......Page 283
Activity 8: Tagging and Releasing with Git......Page 284
_GoBack......Page 285
Appendix......Page 287
Index......Page 339
__DdeLink__5275_573536565......Page 109
_GoBack......Page 121
_GoBack......Page 248
_1ksv4uv......Page 329