Reputation: 21
Two git functions defined in .gitconfig (using alias)
create-file = "!f() { for name in \"$@\"; do echo $name>$name.txt; done; }; f"
m-commit = "!f() { for name in \"$@\"; do git create-file $name; done; }; f"
git m-commit a b c
This runs ok from the top-level directory of a git repo.
How to make it to run it from subdirectory, (to create test files in this subdirectory, not in the top)
Thanks for any help.
Upvotes: 1
Views: 144
Reputation: 531055
The name of the top-level directory is output by git rev-parse --show-toplevel
.
Upvotes: 1