oh-my-git/levels/unused/commit-a
2021-01-11 19:16:35 +01:00

27 lines
543 B
Plaintext

title = Make a commit, but faster!
cards = add reset checkout commit commit-a
[description]
There is a time-saving trick, where instead of a plain `git commit`, you can use
git commit -a
This will automatically add all changes you made to local files! Very convenient.
[setup]
echo a > a
echo b > b
echo c > c
git add .
git commit -m "Initial commit"
echo x > a
echo x > b
echo x > c
[win]
# Make a commit where all files contain "x".
test "$(git show main:a)" = x && test "$(git show main:b)" = x && test "$(git show main:c)" = x