diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-04-09 00:57:09 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-04-09 00:57:09 +0900 |
| commit | 134c88fc4066d5e42615cd55785e155947a76f23 (patch) | |
| tree | d659e47892308c66f4011d8554fa94fd9a8dd9ca | |
| parent | 8638849e598ac7c1b16773059889212909e87ef6 (diff) | |
| download | dotfiles-134c88fc4066d5e42615cd55785e155947a76f23.tar.gz dotfiles-134c88fc4066d5e42615cd55785e155947a76f23.tar.zst dotfiles-134c88fc4066d5e42615cd55785e155947a76f23.zip | |
git: add alias `git init-empty`
| -rw-r--r-- | .config/git/config | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config index c9220e9..c82a726 100644 --- a/.config/git/config +++ b/.config/git/config @@ -178,3 +178,10 @@ }; __fn" setup-hooks = "!cp ~/dotfiles/githooks/* \"$(git rev-parse --show-toplevel)/.git/hooks\"" extract-issue = "!~/bin/gitalias/git-extract-issue" + init-empty = "!__fn() { \ + if [ \"$1\" = \"\" ]; then \ + echo \"usage: git init-empty <user>\" >&2; \ + else \ + git init . && git config-user \"$1\" && git empty -m \"<empty>\"; \ + fi; \ + }; __fn" |
