Skip to content

Commit e5f7e65

Browse files
committed
content: split branches and remotes, reordered topics
1 parent 96c12d0 commit e5f7e65

File tree

14 files changed

+375
-221
lines changed

14 files changed

+375
-221
lines changed

public/code.js

Whitespace-only changes.

public/menu.js

Whitespace-only changes.

src/client/styles/pagination.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
margin: 0;
6363
}
6464

65+
.pagination__buttons .button.inline.prev:hover,
66+
.pagination__buttons .button.inline.next:hover {
67+
color: var(--accent);
68+
}
69+
6570
.pagination__buttons .button.inline.next:before {
6671
content: none;
6772
}

src/content/lessons/advanced-git-features.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,41 @@ order: 9
55
state: 'draft'
66
tags: ['git']
77
links: {
8+
'Referencing commits docs': 'https://git-scm.com/docs/gitrevisions',
89
}
910
---
1011

12+
## Referencing commits
13+
14+
There are many ways to get to a commit.
15+
![example-history](https://git-scm.com/book/en/v2/images/double-dot.png)
16+
17+
```bash
18+
master^ # E
19+
master~2 # B
20+
B^ # A
21+
B~1 # A
22+
^B # everything except A and B
23+
```
24+
25+
---
26+
27+
## Reflog
28+
29+
## Blame
30+
31+
## Tags
32+
33+
## Protocols
34+
35+
## Porcelain vs plumbing
36+
37+
## Exploring the .git directory
38+
39+
## Hooks
40+
41+
## Github actions
42+
1143
<!-- TODO: tags -->
1244

1345
<!-- TODO: reflog -->

src/content/lessons/bash-scripting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Scripting with bash'
33
description: 'Diving deeper into bash features, writing scripts'
4-
order: 7
4+
order: 8
55
state: 'draft'
66
tags: ['bash', 'unix']
77
---

src/content/lessons/closing-thoughts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Closing thoughts'
33
description: "This is just the beginning..."
4-
order: 10
4+
order: 11
55
state: 'draft'
66
tags: ['outro']
77
links: {
@@ -39,4 +39,4 @@ Be curious, get excited, stay positive!
3939

4040
---
4141

42-
# Thank you!
42+
# Thank you

src/content/lessons/git-branches.md

Lines changed: 7 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
---
2-
title: 'Working with branches and remotes'
2+
title: 'Working with branches'
33
description: 'Most projects have a complicated history that is not a straight line and include contributions from multiple people'
4-
order: 5
4+
order: 6
55
state: 'upcoming'
66
tags: ['git']
77
links: {
88
'Git Branching Documentation': 'https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell',
99
'Interactive Git Branching': 'https://learngitbranching.js.org/',
10-
'Referencing commits docs': 'https://git-scm.com/docs/gitrevisions',
1110
}
1211
---
1312

14-
## Short recap
15-
16-
- Git commands are local-first
17-
18-
- Commit often and write good commit messages
19-
20-
- Be careful with commands that can permanently delete files
21-
22-
---
23-
2413
## What Are Branches?
2514

2615
A **branch** in Git is essentially a moveable pointer to a specific commit.
@@ -42,6 +31,7 @@ Branches are incredibly lightweight - creating a branch is just creating a file
4231
---
4332

4433
## Listing Branches
34+
4535
When you create a repository, Git automatically creates a default branch (usually called `main` or `master`).
4636

4737
```bash
@@ -96,6 +86,7 @@ temp
9686
john-branch
9787
new-feature
9888
```
89+
9990
---
10091

10192
## Switching Between Branches
@@ -209,21 +200,6 @@ git log --oneline --graph master...experimental
209200

210201
---
211202

212-
## Referencing commits
213-
214-
There are many ways to get to a commit.
215-
![example-history](https://git-scm.com/book/en/v2/images/double-dot.png)
216-
217-
```bash
218-
master^ # E
219-
master~2 # B
220-
B^ # A
221-
B~1 # A
222-
^B # everything except A and B
223-
```
224-
225-
---
226-
227203
## Detached HEAD
228204

229205
If HEAD points directly at a commit, git will inform you that
@@ -285,139 +261,12 @@ ls
285261

286262
### Feature Branch Workflow
287263

288-
1. Create a repository with a README
289-
2. Create three feature branches: `feature-header`, `feature-footer`, `feature-sidebar`
264+
1. Create a repository called 'my-site'
265+
2. Add a README file
266+
2. Create three branches: `feature-header`, `feature-footer`, `feature-sidebar`
290267
3. Make different changes in each branch
291268
4. Practice viewing the history with `git log --graph --oneline`
292269

293270
</home-work>
294271

295272
</bonus-content>
296-
297-
---
298-
299-
## Remote Repositories
300-
301-
A **remote repository** is a independent version of the project hosted somewhere else (like GitHub, GitLab, or Bitbucket).
302-
303-
It enables collaboration and serves as a backup.
304-
305-
---
306-
307-
### Local vs Remote
308-
309-
![remote-example](https://git-scm.com/book/en/v2/images/remote-branches-1.png)
310-
311-
---
312-
313-
### Common Remote Hosting Services
314-
315-
- **GitHub** - Most popular, great for open source
316-
- **GitLab** - Good for enterprise, built-in CI/CD
317-
- **Bitbucket** - Integrates well with Atlassian tools
318-
- **Azure DevOps** - Microsoft's solution
319-
- **Self-hosted** - Your own server
320-
321-
---
322-
323-
## Adding a Remote
324-
325-
```bash
326-
# Add a remote repository
327-
git remote add origin https://github.com/user/repo.git
328-
329-
# List remotes
330-
git remote -v
331-
332-
# Show detailed remote info
333-
git remote show origin
334-
```
335-
336-
---
337-
338-
### Common Remote Names
339-
340-
- **origin** - Default name for the remote repository that was cloned
341-
- **upstream** - Often used for the original repository when you've forked
342-
- **fork** - Sometimes used for your fork of someone else's repository
343-
344-
> Remote names are local, choose names that make sense for you.
345-
346-
---
347-
348-
## Fetching and Pulling
349-
350-
```bash
351-
# Download changes without merging
352-
git fetch origin
353-
354-
# Download and merge changes
355-
git pull origin main
356-
357-
# Pull with rebase instead of merge
358-
git pull --rebase origin main
359-
```
360-
361-
---
362-
363-
## Pushing to Remote
364-
365-
```bash
366-
# Push current branch to remote
367-
git push origin main
368-
369-
# Push and set upstream tracking
370-
git push -u origin feature-branch
371-
372-
# Push all branches
373-
git push origin --all
374-
375-
# Push tags
376-
git push origin --tags
377-
```
378-
379-
---
380-
381-
## Tracking Remote Branches
382-
383-
```bash
384-
# See all branches (local and remote)
385-
git branch -a
386-
387-
# Create local branch that tracks remote
388-
git checkout -b feature-branch origin/feature-branch
389-
390-
# Simplified version (Git 2.23+)
391-
git switch feature-branch # Auto-tracks if remote exists
392-
```
393-
394-
---
395-
396-
## Working with Remote Branches
397-
398-
```bash
399-
# Create local branch
400-
git checkout -b new-feature
401-
402-
# make changes, commit and push to remote
403-
git push -u origin new-feature
404-
405-
# Delete remote branch
406-
git push origin --delete old-feature
407-
408-
# Update remote tracking branches
409-
git fetch --prune
410-
```
411-
412-
---
413-
414-
## Branch Lifecycle
415-
416-
1. **Create** branch from up-to-date main
417-
2. **Work** on feature with regular commits
418-
3. **Test** thoroughly before merging
419-
4. **Request** code review
420-
5. **Merge** to main after approval
421-
6. **Delete** feature branch after merge
422-
7. **Update** local main branch
423-

0 commit comments

Comments
 (0)