oh-my-git/levels/intro/setup

35 lines
837 B
Text
Raw Normal View History

title = A better way
cards = init commit-auto
2020-10-06 10:51:12 +02:00
[description]
One month later, you're woking on an essay about tardigrades!
This time, a friend has recommended that you use the version control system Git to keep backups of your file.
Currently, your directory only contains your essay. To initialize a Git repository in your directory, use the `init` card!
2020-10-06 10:51:12 +02:00
Then, each time you want to make a backup, use the `commit` card!
2020-10-06 10:51:12 +02:00
That way, you've made a backup of the current version of the file.
2020-10-06 10:51:12 +02:00
[setup]
rm -rf .git
echo "~ Why tardigrades are cool ~
- They can survive in space.
- They are resistant to extreme heat and cold." > essay.txt
[win]
# Initialize a Git repository
test -d .git
# And make another commit
test -d .git && git rev-parse HEAD^
# Add at least two more lines.
test "$(git show HEAD:essay.txt | wc -l)" -ge 6