21 lines
859 B
Bash
21 lines
859 B
Bash
|
#!/bin/zsh
|
||
|
|
||
|
tmp_alias_command='git --git-dir=${HOME}/.dotfiles/ --work-tree=${HOME}'
|
||
|
if [[ -f ~/.ssh/id_dotfiles ]]; then
|
||
|
export GIT_SSH_COMMAND="ssh -i ~/.ssh/id_dotfiles"
|
||
|
tmp_alias_command="GIT_SSH_COMMAND=\"ssh -i ~/.ssh/id_dotfiles\" ${tmp_alias_command}"
|
||
|
fi
|
||
|
alias config="${tmp_alias_command}"
|
||
|
|
||
|
git clone --bare git@schlomp.space:tastytea/dotfiles.git "${HOME}/.dotfiles" && \
|
||
|
config submodule init && \
|
||
|
config submodule update && \
|
||
|
config config --local status.showUntrackedFiles no && \
|
||
|
config config --local submodule.recurse true && \
|
||
|
echo -e "Run \033[1;32mrm ${0} && ${tmp_alias_command} checkout\033[0m to copy the files to your home directory."
|
||
|
unset tmp_alias_config
|
||
|
|
||
|
# TODO: [remote "origin"] needs to have
|
||
|
# fetch = +refs/heads/*:refs/remotes/origin/* in order for
|
||
|
# submodule.recurse to work, but why?
|