Prev
|
Contents
|
Next
Beej's Guide to Git
Brian “Beej Jorgensen” Hall
v0.0.7, Copyright © July 13, 2024
1
Foreword
1.1
Audience
1.2
Official Homepage
1.3
Email Policy
1.4
Mirroring
1.5
Note for Translators
1.6
Copyright and Distribution
1.7
Dedication
2
Git Basics
2.1
What is Git?
2.2
What is GitHub?
2.3
What is GitHub?
2.4
The Most Basic Git Workflow
2.5
What is Cloning?
2.6
How Do Clones Interact?
2.7
Actual Git Usage
2.7.1
Step 0: One-time Setup
2.7.2
Step 1: Clone an Existing Repo
2.7.3
Step 2: Make Some Local Changes
2.7.4
Step 3: Add Changes to the Stage
2.7.5
Step 4: Commit those Changes
2.7.6
Step 5: Push Your Changes to the Remote Repo
3
Using GitHub
3.1
Making a GitHub Account
3.2
Creating a New Repo on GitHub
3.3
Authentication
3.3.1
GitHub CLI
3.3.2
SSH Keys
3.4
Make a Local Clone of the Repo
3.4.1
Cloning from GitHub with GitHub CLI
3.4.2
Cloning from GitHub with SSH Keys
3.5
Make Changes and Push!
3.6
Collaboration on GitHub
4
The Git Log and
HEAD
4.1
An Example Log
4.2
What’s in the log?
4.3
The
HEAD
Reference
4.4
Going Back In Time and Detached
HEAD
4.5
The New Command:
git switch
5
Branches and Fast-Forward Merges
5.1
What is a Branch?
5.2
A Quick Note about
git pull
5.3
HEAD
and Branches
5.4
Creating a Branch
5.5
Make Some Commits on a Branch
5.6
Merging: Fast-Forward
5.7
Deleting a Branch
6
Merging and Conflicts
6.1
An Example of Divergent Branches
6.2
Merging Divergent Branches
6.3
Merge Conflicts
6.4
What a Conflict Looks Like
6.5
Why Merge Conflicts Happen
6.6
Merging with IDEs or other Merge Tools
6.7
Merge Big Ideas
7
Using Subdirectories with Git
7.1
Repos and Subdirectories
7.1.1
What about Subprojects?
7.2
Accidentally Making a Repo in your Home Directory
7.3
Empty Subdirectories in Repos
8
Ignoring Files with
.gitignore
8.1
Adding a
.gitignore
File
8.2
Can I Specify Subdirectories in
.gitignore
?
8.3
Where do I Put the
.gitignore
?
8.4
Wildcards
8.5
Negated
.gitignore
Rules
8.6
How To Ignore All Files Except a Few?
8.7
Getting Premade
.gitignore
Files
9
Remotes
9.1
Remote and Branch Notation
9.2
Getting a List of Remotes
9.3
Renaming a Remote
9.4
Adding a Remote
10
Remote Tracking Branches
10.1
Branches on Remotes
10.2
Pushing to a Remote
10.3
Making a Branch and Pushing to Remote
11
File States
11.1
What States Can Files in Git Be In?
11.2
Renaming Files
11.3
Removing Files
11.4
Unmodified to Untracked
12
Collaboration across Branches
12.1
Communication and Delegation
12.2
Approach: Everyone Uses One Branch
12.3
Approach: Everyone Uses Their Own Branch
12.4
Approach: Everyone Merges to the Dev Branch
13
Appendix: Making a Playground
13.1
Cloning Bare Repos
13.2
Automating Playground Builds
14
Appendix: Getting Out of Editors
15
Appendix: Errors and Scary Messages
15.1
Detached Head
15.2
Upstream Branch Name Doesn’t Match Current
15.3
Current Branch Has No Upstream Branch
Prev
|
Contents
|
Next