mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Rename chapters into "internals" and "intro"
This commit is contained in:
parent
70fe577788
commit
f3ff5c5147
97 changed files with 0 additions and 0 deletions
levels/intro
28
levels/intro/commit
Normal file
28
levels/intro/commit
Normal file
|
@ -0,0 +1,28 @@
|
|||
title = "fu"
|
||||
|
||||
[description]
|
||||
|
||||
So you've been working on a project for a while, and decide you want to put it in a Git repository.
|
||||
|
||||
Here's how to do it! First, you initialize a new Git repository in your current directory:
|
||||
|
||||
git init
|
||||
|
||||
Then say that you want to record the current state of all files:
|
||||
|
||||
git add .
|
||||
|
||||
And then you make a commit, which gives the current state a description, a date, and your name:
|
||||
|
||||
git commit
|
||||
|
||||
[setup]
|
||||
|
||||
mkdir recipes
|
||||
echo -e "blueberries\nflour" > recipes/blueberry_cake.txt
|
||||
echo -e "water\ncarrots" > recipes/carrot soup.txt
|
||||
echo "Very good recipes!" > README.md
|
||||
|
||||
[win]
|
||||
|
||||
test "$(git rev-parse HEAD^{tree})" = 1e02e3151284d0e22cd9b07ca5c5dbae2f3cb521
|
32
levels/intro/pull-merge-push
Normal file
32
levels/intro/pull-merge-push
Normal file
|
@ -0,0 +1,32 @@
|
|||
title = A pull and a conflict
|
||||
author = blinry
|
||||
|
||||
[description]
|
||||
|
||||
You want to push your new commits to the server, but someone has already pushed their own changes.
|
||||
|
||||
In this situation, you need to pull first! Try that here - you'll have to resolve a merge conflict. Push your changes afterwards.
|
||||
|
||||
[congrats]
|
||||
|
||||
Good job! Here's some additional info: banana!
|
||||
|
||||
[setup yours]
|
||||
|
||||
echo fu > file
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
git push
|
||||
|
||||
echo fi > file
|
||||
git commit -a -m "Fi is good"
|
||||
|
||||
[setup origin]
|
||||
|
||||
echo fa > file
|
||||
git add .
|
||||
git commit -a -m "Fa is good"
|
||||
|
||||
[win origin]
|
||||
|
||||
test "$(git rev-parse HEAD^1^)" = "$(git rev-parse HEAD^2^)"
|
20
levels/intro/rebase
Normal file
20
levels/intro/rebase
Normal file
|
@ -0,0 +1,20 @@
|
|||
description = Rebase all branches on top of the main branch, so that the commits are in alphabetical order, and then point the main branch to the top commit.
|
||||
|
||||
[setup]
|
||||
|
||||
git commit --allow-empty -m A
|
||||
git commit --allow-empty -m B
|
||||
git commit --allow-empty -m C
|
||||
|
||||
git switch -c side1 main~1
|
||||
git commit --allow-empty -m D
|
||||
git commit --allow-empty -m E
|
||||
|
||||
git switch -c side2 main~2
|
||||
git commit --allow-empty -m F
|
||||
|
||||
git checkout main
|
||||
|
||||
[win]
|
||||
|
||||
diff <(git log --pretty=%s main) <(echo -e "F\nE\nD\nC\nB\nA")
|
8
levels/intro/sandbox
Normal file
8
levels/intro/sandbox
Normal file
|
@ -0,0 +1,8 @@
|
|||
[setup local]
|
||||
|
||||
git commit --allow-empty -m "1"
|
||||
git commit --allow-empty -m "2"
|
||||
git commit --allow-empty -m "3"
|
||||
git push
|
||||
|
||||
[setup origin]
|
1
levels/intro/sequence
Normal file
1
levels/intro/sequence
Normal file
|
@ -0,0 +1 @@
|
|||
sandbox
|
Loading…
Add table
Add a link
Reference in a new issue