Skip to content

Commit 8963b44

Browse files
committed
content: advanced git features, workflows, split into smaller lessons
1 parent 245d8c9 commit 8963b44

File tree

11 files changed

+682
-221
lines changed

11 files changed

+682
-221
lines changed

src/content/bonus/beyond-git.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: 'Beyond git'
3+
description: 'Git integrations, Github actions, git alternatives'
4+
hasSlides: false
5+
links: {
6+
'Jujitsu: a VCS on top of git': 'https://github.com/jj-vcs/jj',
7+
}
8+
---
9+
10+
## Github actions
11+
12+
---
13+
14+
## Beyond git
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: 'Fixing common problems within git'
3+
description: 'Examples of problematic situations and how to fix them'
4+
hasSlides: false
5+
links: {
6+
}
7+
---
8+
9+
## Troubleshooting Common Issues
10+
11+
### "Branch is X commits behind main"
12+
13+
```bash
14+
# Option 1: Merge main into feature
15+
git checkout feature-branch
16+
git merge main
17+
18+
# Option 2: Rebase feature onto main (cleaner)
19+
git checkout feature-branch
20+
git rebase main
21+
```
22+
23+
---
24+
25+
### "Your branch and origin/main have diverged"
26+
27+
```bash
28+
# See what happened
29+
git log --oneline --graph --all
30+
31+
# Usually need to pull with merge or rebase
32+
git pull origin main
33+
# or
34+
git pull --rebase origin main
35+
```
36+
37+
---
38+
39+
### Accidentally Committed to Wrong Branch
40+
41+
```bash
42+
# Move last commit to correct branch
43+
git checkout correct-branch
44+
git cherry-pick wrong-branch
45+
git checkout wrong-branch
46+
git reset --hard HEAD~1
47+
```
48+
49+
---
50+
51+
### Lost Work After Branch Switch
52+
53+
```bash
54+
# Find lost commits
55+
git reflog
56+
57+
# Recover lost work
58+
git checkout <commit-hash>
59+
git checkout -b recovered-work
60+
```
61+

0 commit comments

Comments
 (0)