chore: update gitconfig structure and add base config
This commit is contained in:
4
.gitconfig.d/.gitignore
vendored
4
.gitconfig.d/.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!example.gitconfig
|
!example.gitconfig
|
||||||
|
!base.gitconfig
|
||||||
|
!var
|
8
.gitconfig.d/base.gitconfig
Normal file
8
.gitconfig.d/base.gitconfig
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[credential]
|
||||||
|
helper = store
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
[core]
|
||||||
|
autocrlf = false
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
CONFIG_DIR="$DOTFILES_INSTALL_DIR/.gitconfig.d"
|
CONFIG_DIR="$DOTFILES_INSTALL_DIR/.gitconfig.d/var"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "[+] Generating Gitconfig"
|
echo "[+] Generating Gitconfig"
|
||||||
@ -8,6 +8,8 @@ echo
|
|||||||
|
|
||||||
rm -f "$HOME/.gitconfig"
|
rm -f "$HOME/.gitconfig"
|
||||||
|
|
||||||
|
cp "$DOTFILES_INSTALL_DIR/.gitconfig.d/base.gitconfig" "$HOME/.gitconfig"
|
||||||
|
|
||||||
for config in "$CONFIG_DIR"/*.gitconfig; do
|
for config in "$CONFIG_DIR"/*.gitconfig; do
|
||||||
[ -e "$config" ] || continue
|
[ -e "$config" ] || continue
|
||||||
|
|
||||||
@ -23,7 +25,6 @@ for config in "$CONFIG_DIR"/*.gitconfig; do
|
|||||||
echo "Create config for $domain"
|
echo "Create config for $domain"
|
||||||
|
|
||||||
cat <<EOF >> "$HOME/.gitconfig"
|
cat <<EOF >> "$HOME/.gitconfig"
|
||||||
|
|
||||||
[includeIf "hasconfig:remote.*.url:https://**$domain/**"]
|
[includeIf "hasconfig:remote.*.url:https://**$domain/**"]
|
||||||
path = $config
|
path = $config
|
||||||
EOF
|
EOF
|
||||||
|
Reference in New Issue
Block a user