mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
finished the mechanism for setting the language
This commit is contained in:
parent
705cc849c2
commit
50ee071f0e
214 changed files with 94 additions and 10 deletions
levels/en_EN/low-level
31
levels/en_EN/low-level/commit-parents
Normal file
31
levels/en_EN/low-level/commit-parents
Normal file
|
@ -0,0 +1,31 @@
|
|||
[description]
|
||||
|
||||
When using the commit-tree command, you can optionally specify a parent:
|
||||
|
||||
git commit-tree <tree> -m "Description" -p <parent commit>
|
||||
|
||||
Make a string of three commits!
|
||||
|
||||
Hint: You'll need a tree object. What could be the easiest way to obtain one?
|
||||
|
||||
[setup]
|
||||
|
||||
[setup goal]
|
||||
|
||||
git write-tree
|
||||
FIRST_COMMIT=$(git commit-tree 4b82 -m 'First commit :O')
|
||||
SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Second commit :D')
|
||||
THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Third commit \o/')
|
||||
|
||||
[win]
|
||||
|
||||
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
|
||||
|
||||
for COMMIT in $COMMITS; do
|
||||
echo a commit named $COMMIT
|
||||
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
Loading…
Add table
Add a link
Reference in a new issue