From ac5f5ca116028cb6eff346e46fc33e2aeaa44e6c Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Fri, 26 Jan 2024 23:49:54 +0100 Subject: [PATCH] Git config --- .../bhasher/.config/custom/git/.gitconfig | 50 +++++++++++++++++++ .../custom/git/.gitconfig-forge.uclouvain.be | 7 +++ .../custom/git/.gitconfig-git.bhasher.com | 3 ++ .../custom/git/.gitconfig-git.licolas.net | 3 ++ .../.config/custom/git/.gitconfig-github.com | 3 ++ .../.config/custom/git/.gitconfig-gitlab.com | 4 ++ .../.config/custom}/git/.gitignore_global | 0 root/home/bhasher/.gitconfig | 4 +- scripts/sync.sh | 11 ++-- 9 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 root/home/bhasher/.config/custom/git/.gitconfig create mode 100755 root/home/bhasher/.config/custom/git/.gitconfig-forge.uclouvain.be create mode 100755 root/home/bhasher/.config/custom/git/.gitconfig-git.bhasher.com create mode 100755 root/home/bhasher/.config/custom/git/.gitconfig-git.licolas.net create mode 100755 root/home/bhasher/.config/custom/git/.gitconfig-github.com create mode 100644 root/home/bhasher/.config/custom/git/.gitconfig-gitlab.com rename {configs => root/home/bhasher/.config/custom}/git/.gitignore_global (100%) diff --git a/root/home/bhasher/.config/custom/git/.gitconfig b/root/home/bhasher/.config/custom/git/.gitconfig new file mode 100644 index 0000000..046ca6a --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig @@ -0,0 +1,50 @@ +[credential] + helper = bw +[core] + editor = vim + autocrlf = input + +[user] + email = git@bhasher.com + name = Brieuc Dubois +[commit] + gpgsign = false +[init] + defaultBranch = master +[gpg] + program = gpg +[color] + ui = auto + diff = auto + status = auto + branch = auto +[help] + autocorrect = 30 +[alias] + graph = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold blue)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all + logdoga = log --decorate --oneline --graph --all + s = status + d = diff +[push] + default = simple + +[includeIf "hasconfig:remote.*.url:https://git.bhasher.com/**"] + path = .gitconfig-git.bhasher.com + +[includeIf "hasconfig:remote.*.url:https://git.licolas.net/**"] + path = .gitconfig-git.licolas.net + +[includeIf "hasconfig:remote.*.url:https://forge.uclouvain.be/**"] + path = .gitconfig-forge.uclouvain.be + +[includeIf "hasconfig:remote.*.url:git@forge.uclouvain.be:**"] + path = .gitconfig-forge.uclouvain.be + +[includeIf "hasconfig:remote.*.url:https://github.com/**"] + path = .gitconfig-github.com + +[includeIf "hasconfig:remote.*.url:git@github.com:**"] + path = .gitconfig-github.com + +[includeIf "hasconfig:remote.*.url:https://gitlab.com/**"] + path = .gitconfig-gitlab.com diff --git a/root/home/bhasher/.config/custom/git/.gitconfig-forge.uclouvain.be b/root/home/bhasher/.config/custom/git/.gitconfig-forge.uclouvain.be new file mode 100755 index 0000000..db82f92 --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig-forge.uclouvain.be @@ -0,0 +1,7 @@ +[user] + email = brieuc.a.dubois@student.uclouvain.be + name = Dubois Brieuc +# signingkey = C813418463720FBE + +[commit] + gpgsign = false diff --git a/root/home/bhasher/.config/custom/git/.gitconfig-git.bhasher.com b/root/home/bhasher/.config/custom/git/.gitconfig-git.bhasher.com new file mode 100755 index 0000000..938f255 --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig-git.bhasher.com @@ -0,0 +1,3 @@ +[user] + email = git@bhasher.com + name = Brieuc Dubois diff --git a/root/home/bhasher/.config/custom/git/.gitconfig-git.licolas.net b/root/home/bhasher/.config/custom/git/.gitconfig-git.licolas.net new file mode 100755 index 0000000..4e259b6 --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig-git.licolas.net @@ -0,0 +1,3 @@ +[user] + email = git.licolas@bhasher.com + name = Brieuc Dubois diff --git a/root/home/bhasher/.config/custom/git/.gitconfig-github.com b/root/home/bhasher/.config/custom/git/.gitconfig-github.com new file mode 100755 index 0000000..e6725a5 --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig-github.com @@ -0,0 +1,3 @@ +[user] + email = github.it@bhasher.com + name = Bhasher diff --git a/root/home/bhasher/.config/custom/git/.gitconfig-gitlab.com b/root/home/bhasher/.config/custom/git/.gitconfig-gitlab.com new file mode 100644 index 0000000..a9a00d3 --- /dev/null +++ b/root/home/bhasher/.config/custom/git/.gitconfig-gitlab.com @@ -0,0 +1,4 @@ +[user] + email = github.it@bhasher.com + name = Brieuc Dubois + diff --git a/configs/git/.gitignore_global b/root/home/bhasher/.config/custom/git/.gitignore_global similarity index 100% rename from configs/git/.gitignore_global rename to root/home/bhasher/.config/custom/git/.gitignore_global diff --git a/root/home/bhasher/.gitconfig b/root/home/bhasher/.gitconfig index 4e094f9..9d0e60a 100644 --- a/root/home/bhasher/.gitconfig +++ b/root/home/bhasher/.gitconfig @@ -1,8 +1,8 @@ [include] - path = ~/Documents/sync/.config/git/.gitconfig + path = ~/.config/custom/git/.gitconfig [safe] directory = /opt/flutter [core] - excludesfile = /home/bhasher/.gitignore_global + excludesfile = ~/.config/custom/git/.gitignore_global [init] defaultBranch = master diff --git a/scripts/sync.sh b/scripts/sync.sh index c7e576a..ec6e124 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -3,18 +3,23 @@ src_dir="../root" dst_dir="/" +amount=0 + function create_hard_links() { local src_path="$1" local dst_path="$2" - for item in "$src_path"/*; do + for item in "$src_path"/* "$src_path"/.[^.]*; do if [ -d "$item" ]; then mkdir -p "${dst_path}${item#$src_path}/" create_hard_links "$item" "${dst_path}${item#$src_path}/" elif [ -f "$item" ] && [[ ! "$item" =~ \.enc$ ]]; then - ln "$item" "${dst_path}${item#$src_path}" + ln -f "$item" "${dst_path}${item#$src_path}" + amount=$((amount+1)) fi done } -create_hard_links "$src_dir" "$dst_dir" \ No newline at end of file +create_hard_links "$src_dir" "$dst_dir" + +echo "Hard links created: $amount" \ No newline at end of file