2020-10-12 20:09:51 +02:00
|
|
|
title = A better way
|
2021-01-07 12:57:31 +01:00
|
|
|
cards = init commit-auto
|
2020-10-12 20:09:51 +02:00
|
|
|
|
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.
|
|
|
|
|
2021-01-07 12:57:31 +01:00
|
|
|
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
|
|
|
|
2021-01-07 12:57:31 +01:00
|
|
|
Then, each time you want to make a backup, use the `commit` card!
|
2020-10-06 10:51:12 +02:00
|
|
|
|
2021-01-07 12:57:31 +01: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]
|
|
|
|
|
2021-01-07 12:57:31 +01:00
|
|
|
# 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
|