mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-07 05:02:04 +02:00
config level, clone level, PR level
This commit is contained in:
parent
8a86009e2f
commit
023a98cfae
8 changed files with 110 additions and 2 deletions
levels
20
levels/intro/clone
Normal file
20
levels/intro/clone
Normal file
|
@ -0,0 +1,20 @@
|
|||
title = Cloning a repo
|
||||
cards = clone commit-auto pull push
|
||||
|
||||
[description]
|
||||
|
||||
Get your friend's repo using clone, change something, push it back.
|
||||
|
||||
[setup]
|
||||
|
||||
rm -rf .git
|
||||
|
||||
[setup friend]
|
||||
|
||||
echo hi > file
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
[win friend]
|
||||
|
||||
test "$(git show main:file)" != hi
|
23
levels/intro/who-are-you
Normal file
23
levels/intro/who-are-you
Normal file
|
@ -0,0 +1,23 @@
|
|||
title = Nice to meet you!
|
||||
cards = config-name config-email
|
||||
|
||||
[description]
|
||||
|
||||
Introduce yourself using
|
||||
|
||||
git config --global user.name Firstname
|
||||
git config --global user.email "your@mail.com"
|
||||
|
||||
[setup]
|
||||
|
||||
[actions]
|
||||
|
||||
test "$(git config user.name)" != "You" && hint "Hey $(git config user.name), nice to meet you!"
|
||||
|
||||
[win]
|
||||
|
||||
# Have a name configured.
|
||||
test "$(git config user.name)" != "You"
|
||||
|
||||
# Have an email address configured.
|
||||
test "$(git config user.email)" != "you@time.agency"
|
18
levels/workflows/gitignore
Normal file
18
levels/workflows/gitignore
Normal file
|
@ -0,0 +1,18 @@
|
|||
title = Ignoring files
|
||||
|
||||
[description]
|
||||
|
||||
That chicken is running around a lot, and changing often. We don't want to have it in our commits.
|
||||
|
||||
Add it to the file .gitignore, and try using `git add .`!
|
||||
|
||||
[setup]
|
||||
|
||||
touch .gitignore
|
||||
echo important > important
|
||||
git add important
|
||||
git commit -m "Initial commit"
|
||||
|
||||
[actions]
|
||||
|
||||
echo "$RANDOM" > chicken
|
25
levels/workflows/pr
Normal file
25
levels/workflows/pr
Normal file
|
@ -0,0 +1,25 @@
|
|||
title = Cloning a repo
|
||||
cards = clone commit-auto reset-hard checkout file-new branch
|
||||
|
||||
[description]
|
||||
|
||||
Your friend has a problem! Clone the repo, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`.
|
||||
|
||||
[setup]
|
||||
|
||||
rm -rf .git
|
||||
|
||||
[setup friend]
|
||||
|
||||
echo "2 + 3 = " > file
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
[actions friend]
|
||||
|
||||
git ls-remote yours | grep pr && git fetch yours && git merge yours/solution
|
||||
git show main:file | grep 5 && hint "Thanks!"
|
||||
|
||||
[win friend]
|
||||
|
||||
git show main:file | grep 5
|
Loading…
Add table
Add a link
Reference in a new issue