Skip to content

Commit 5d8364e

Browse files
author
Jordan McCullough
committed
Merge pull request #188 from github/curriculum-advanced-tune-up
Update/tune Advanced deck section, content, headings
2 parents 254acc1 + dfffcf2 commit 5d8364e

File tree

1 file changed

+78
-75
lines changed

1 file changed

+78
-75
lines changed

advanced/index.md

Lines changed: 78 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@ title: GitHub Advanced
44
description: Mastering Git and GitHub
55
---
66

7+
This curriculum will be your companion to the GitHub Advanced class taught by the GitHub Training Team and other educational groups. In this course, you'll explore strategies for branch and history rewriting, temporary storing and recovery techniques, and Git technology mechanics for faster problem solving.
8+
9+
### Understanding Git
10+
11+
* Directed acyclic graph
12+
* Tree object
13+
* Blob object
14+
* SHA1
15+
16+
{% capture svg_path %}../assets/diagrams/commit-data-structure.svg{% endcapture %}
17+
{% include svg %}
18+
19+
* Linked list of commits
20+
* First commit has `nil` parent
21+
* Integrity checking with `git gc`
22+
23+
{% capture svg_path %}../assets/diagrams/commit-dag.svg{% endcapture %}
24+
{% include svg %}
25+
26+
#### Treeish & commitish
27+
28+
* Simple ways of describing history points
29+
* Easier-to-describe and understand numerically
30+
* Application of patterns works on [GitHub](https://help.github.com/articles/comparing-commits-across-time)
31+
32+
```
33+
HEAD
34+
HEAD^^
35+
HEAD~2
36+
HEAD@{one.day.ago}
37+
HEAD@{today}
38+
```
39+
40+
41+
742
### Common branching strategies
843

944
#### Summary
@@ -107,36 +142,18 @@ $ git checkout -b [branch] [base]
107142
```bash
108143
# Stage by patch
109144
$ git add -p [file]
110-
```
111-
112-
113-
### Understanding Git
114-
{% capture svg_path %}../assets/diagrams/commit-data-structure.svg{% endcapture %}
115-
{% include svg %}
116-
117-
* Directed acyclic graph
118-
* Tree object
119-
* Blob object
120-
* SHA1
121-
122-
{% capture svg_path %}../assets/diagrams/commit-dag.svg{% endcapture %}
123-
{% include svg %}
124145

125-
* Linked list of commits
126-
* First commit has `nil` parent
127-
* Integrity checking with `git gc`
146+
# Unstage by patch
147+
git reset reset HEAD -p [file]
148+
```
128149

150+
### Branch best practices
129151

130-
### Best Practices
131-
* Collapsing commits during merge
152+
* Pros/cons of collapsing commits during merge
153+
* Relation to branching strategies and deliverable expectations
132154
* Checking merge state
133155
* Cleaning up branches
134156

135-
#### Squash merging
136-
* Collapsing commits during merge
137-
* Pros/cons (loss of granularity)
138-
* Relation to branching strategies and deliverable expectations
139-
140157
```shell
141158
$ git merge --squash [branch]
142159
```
@@ -249,16 +266,13 @@ $ git stash -p
249266
### Incorporating History
250267

251268
* Reusing small pieces of code with `cherry-pick`
252-
* Why use `cherry-pick` instead of `merge`?
253-
* What happens when you `cherry-pick`?
254-
* Maintaining `author` and `committer` fields
255-
* Tracing any cherry-picks with `-x` commit message metadata
256-
* `-x` metadata hyperlinked on GitHub
257-
* `$ git cherry` to view absent commits
258-
* Rebase interactive
259-
* Can include cherry-pick
260-
* Must remember to continue the rebase
261-
* Alters history
269+
* Why use `cherry-pick` instead of `merge`?
270+
* What happens when you `cherry-pick`?
271+
* Maintaining `author` and `committer` fields
272+
* Tracing any cherry-picks with `-x` commit message metadata
273+
* `-x` metadata hyperlinked on GitHub
274+
* `$ git cherry` to view absent commits
275+
* Can include cherry-pick during rebase interactive
262276

263277
```shell
264278
# Generate new commit on current branch
@@ -325,7 +339,7 @@ $ git add [conflicting-file]
325339
$ git rebase --continue
326340
```
327341

328-
### Reordering History
342+
#### Reordering History
329343

330344
* Reorder commits
331345
* Rewrite history entirely
@@ -352,7 +366,7 @@ $ git rebase -i --autosquash [ref]
352366
```
353367

354368

355-
### Fixing Branches
369+
#### Fixing Branches
356370
* This mode of rebase change where branch history begins
357371
* Moving blocks of history around
358372

@@ -369,7 +383,7 @@ $ git rebase --onto <newbase> <upstream> <HEAD|branch>
369383

370384
### Cutting Releases
371385

372-
### Summary
386+
#### Summary
373387
* Why create a tag through the web UI?
374388
* Not a branch HEAD. Points to a specific commit.
375389
* Attaching binaries to releases (Web UI and API)
@@ -407,7 +421,7 @@ $ git push origin :[tag-name-to-delete]
407421
```
408422

409423

410-
### Reviewing synchronizing
424+
### Reviewing & synchronizing
411425

412426
#### Reviewing remote branches
413427
* PRs to horizontal contributors
@@ -455,21 +469,7 @@ $ git checkout FETCH_HEAD
455469
$ git branch <newbranchname> FETCH_HEAD
456470
```
457471

458-
459-
### Customizing Interaction
460-
* Specification for retrieval and pushing
461-
* Implied on fetch, pull, and push
462-
* Altered by option switches like `--tags`
463-
* Stored in `.git/config`
464-
* Ability to retrieve Pull Request branches
465-
466-
```shell
467-
$ git fetch [repo-url] [source]:[destination]
468-
$ git config --add remote.[upstream].fetch "+refs/pull/*/head:refs/remotes/[upstream]/pull/*"
469-
```
470-
471-
472-
### Maintaining Remotes
472+
#### Maintaining, customizing remotes
473473
* Remove non-matching _local_ remote branches
474474
* Remove non-matching remote upstream branches
475475
* Remove only remote upstream branch
@@ -483,6 +483,17 @@ $ git fetch --prune
483483
$ git push origin :<branch-name>
484484
```
485485

486+
#### Customizing Interaction
487+
* Specification for retrieval and pushing
488+
* Implied on fetch, pull, and push
489+
* Altered by option switches like `--tags`
490+
* Stored in `.git/config`
491+
* Ability to retrieve Pull Request branches
492+
493+
```shell
494+
$ git fetch [repo-url] [source]:[destination]
495+
$ git config --add remote.[upstream].fetch "+refs/pull/*/head:refs/remotes/[upstream]/pull/*"
496+
```
486497

487498
### Aggregating repositories
488499

@@ -507,8 +518,7 @@ or
507518
$ git submodule update --init --recursive
508519
```
509520

510-
511-
### Incorporating dependencies with subtree
521+
#### Dependencies with subtree
512522

513523
* Alternative to submodule
514524
* All files available advantage
@@ -549,10 +559,22 @@ $ git merge --squash
549559
* Hub and GH merging into one project
550560

551561
```shell
562+
# Create a new public repository on your GitHub account
552563
$ gh create
564+
565+
# Create a new private repository on your GitHub account
566+
$ gh create -p
567+
568+
# Open a Pull Request for the current branch
553569
$ gh pull-request
570+
571+
# Create a fork of the cloned repository on your GitHub Account
554572
$ gh fork
573+
574+
# Launch a web browser with the branch comparison view
555575
$ gh compare
576+
577+
# Launch a web browser to the repository home page
556578
$ gh browse
557579
```
558580

@@ -644,20 +666,7 @@ $ git clean -fd
644666
$ git clean -fx
645667
```
646668

647-
### Treeish & commitish
648-
649-
#### Summary
650-
* Simple ways of describing history points
651-
* Easier-to-describe and understand numerically
652-
653-
#### Details
654-
```
655-
HEAD
656-
HEAD^^
657-
HEAD~2
658-
```
659-
660-
### Diff Tool
669+
### Diff & merge tool
661670

662671
#### Summary
663672
* [P4Merge](http://www.perforce.com/downloads/Perforce/20-User)
@@ -688,12 +697,6 @@ A sample `.gitconfig` file:
688697
prompt = false
689698
```
690699

691-
### Merge Tool
692-
693-
#### Summary
694-
* Same as difftool, but 3-way comparison
695-
696-
#### Details
697700

698701
Mergetool execution:
699702

0 commit comments

Comments
 (0)