diff --git a/rcrc b/rcrc index edf139a..ad30da2 100644 --- a/rcrc +++ b/rcrc @@ -1,3 +1,4 @@ +COPY_ALWAYS="git_template/HEAD" DOTFILES_DIRS="$HOME/dotfiles-local $HOME/dotfiles" EXCLUDES="install.sh README.md" SYMLINK_DIRS="completion-scripts composer bin functions configs" diff --git a/tag-git/git_template/HEAD b/tag-git/git_template/HEAD new file mode 100644 index 0000000..b870d82 --- /dev/null +++ b/tag-git/git_template/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/tag-git/gitconfig b/tag-git/gitconfig index 91743bc..319081b 100644 --- a/tag-git/gitconfig +++ b/tag-git/gitconfig @@ -100,6 +100,9 @@ [include] path = ~/.gitconfig.local +[init] + templatedir = ~/.git_template + [merge] ff = only diff --git a/tag-zsh/zsh/configs/git.zsh b/tag-zsh/zsh/configs/git.zsh index e789c91..e13d94b 100644 --- a/tag-zsh/zsh/configs/git.zsh +++ b/tag-zsh/zsh/configs/git.zsh @@ -1,13 +1,7 @@ # No arguments: `git status` # With arguments: acts like `git` g() { - if [[ $1 == init ]]; - then - # Prefer "main" to "master" - git "$@" - git checkout -b main - git branch -d master - elif [[ $# > 0 ]]; + if [[ $# > 0 ]]; then git $@ else