mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-15 05:02:24 +02:00
Convert "internal" levels to new level format
This commit is contained in:
parent
613b1b9852
commit
53a6885ef9
108 changed files with 727 additions and 382 deletions
levels/internals
37
levels/internals/commit-create
Normal file
37
levels/internals/commit-create
Normal file
|
@ -0,0 +1,37 @@
|
|||
[description]
|
||||
|
||||
So a tree describes a directory structure at a specific point in time.
|
||||
|
||||
It would be nice if we could remember when that state existed, and who authored it, right?
|
||||
|
||||
Enter: commits. They are objects that point to a tree and contain some additional metadata. You can create a commit using
|
||||
|
||||
git commit-tree <tree> -m "Description of your commit"
|
||||
|
||||
Make a commit from the tree in this repository!
|
||||
|
||||
[setup]
|
||||
|
||||
touch empty_file
|
||||
git add .
|
||||
git write-tree
|
||||
|
||||
rm empty_file
|
||||
git update-index --remove empty_file
|
||||
|
||||
[setup goal]
|
||||
|
||||
touch empty_file
|
||||
git add .
|
||||
git write-tree
|
||||
|
||||
rm empty_file
|
||||
git update-index --remove empty_file
|
||||
|
||||
git commit-tree 3185 -m 'Clever commit message'
|
||||
|
||||
[win]
|
||||
|
||||
COMMIT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | wc -l)
|
||||
|
||||
test "$COMMIT_COUNT" -gt 0
|
|
@ -1,9 +0,0 @@
|
|||
So a tree describes a directory structure at a specific point in time.
|
||||
|
||||
It would be nice if we could remember when that state existed, and who authored it, right?
|
||||
|
||||
Enter: commits. They are objects that point to a tree and contain some additional metadata. You can create a commit using
|
||||
|
||||
git commit-tree <tree> -m "Description of your commit"
|
||||
|
||||
Make a commit from the tree in this repository!
|
|
@ -1 +0,0 @@
|
|||
git commit-tree 3185 -m 'Clever commit message'
|
|
@ -1,6 +0,0 @@
|
|||
touch empty_file
|
||||
git add .
|
||||
git write-tree
|
||||
|
||||
rm empty_file
|
||||
git update-index --remove empty_file
|
|
@ -1,3 +0,0 @@
|
|||
COMMIT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | wc -l)
|
||||
|
||||
test "$COMMIT_COUNT" -gt 0
|
Loading…
Add table
Add a link
Reference in a new issue