Quellcode durchsuchen

feat(gitconfig): Add git configuration files

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO vor 2 Jahren
Ursprung
Commit
602f56f882
5 geänderte Dateien mit 77 neuen und 0 gelöschten Zeilen
  1. 21 0
      config.yaml
  2. 40 0
      dotfiles/gitconfig
  3. 7 0
      dotfiles/gitconfig-personal
  4. 6 0
      dotfiles/gitconfig-work
  5. 3 0
      dotfiles/gitignore_global

+ 21 - 0
config.yaml

@@ -39,6 +39,22 @@ dotfiles:
   d_powerline:
     src: config/powerline
     dst: ~/.config/powerline
+  f_gitconfig:
+    src: gitconfig
+    dst: ~/.gitconfig
+  f_gitconfig-personal:
+    src: gitconfig-personal
+    dst: ~/.gitconfig-personal
+  f_gitconfig-work:
+    src: gitconfig-work
+    dst: ~/.gitconfig-work
+  f_gitignore_global:
+    src: gitignore_global
+    dst: ~/.gitignore_global
+  f_aliases.sh:
+    src: config/direnv/lib/aliases.sh
+    dst: ~/.config/direnv/lib/aliases.sh
+    chmod: '755'
 profiles:
   Thinkpad-vhdx:
     dotfiles:
@@ -51,3 +67,8 @@ profiles:
     - f_profile
     - f_config
     - d_powerline
+    - f_gitconfig
+    - f_gitconfig-personal
+    - f_gitconfig-work
+    - f_gitignore_global
+    - f_aliases.sh

+ 40 - 0
dotfiles/gitconfig

@@ -0,0 +1,40 @@
+# Ref:
+#	https://blog.hao.dev/how-to-use-different-git-emails-for-personal-and-work-repositories-on-the-same-machine
+[core]
+        sshCommand = /usr/sbin/ssh-ident
+        excludesfile = ~/.gitignore_global
+[user]
+        email = jeremy.mauro@gmail.com
+        name = Jeremy MAURO
+[alias]
+        cox = commit --signoff --trailer "jira:AVXSRE"
+        coxa = commit --signoff --trailer "jira:AVXSRE" --amend
+        rc  = rebase --continue
+				unstaged = restore --staged
+        brprune = !"f() { \
+          BRANCH_TO_REMOVE=$(git branch -vv | \
+            grep 'origin/.*: gone]' | \
+          awk '{print $1}') ; \
+          [ -z \"${BRANCH_TO_REMOVE}\" ] || echo ${BRANCH_TO_REMOVE} |  xargs git branch -D ;\
+          git branch -av ;\
+          }; f"
+
+[includeIf "gitdir:~/repo/aviatrix/"]
+	path = ~/.gitconfig-work
+[includeIf "gitdir:~/repo/personal/"]
+	path = ~/.gitconfig-personal
+[url "git@github.com:"]
+	insteadOf = https://github.com/
+[url "git@github"]
+	com = .insteadof=https://github.com/
+[credential "https://github.com"]
+	helper = 
+	helper = !/usr/bin/gh auth git-credential
+[credential "https://gist.github.com"]
+	helper = 
+	helper = !/usr/bin/gh auth git-credential
+[trailer "jira"]
+	key = "JIRA: "
+	ifExists = addIfDifferentNeighbor
+	where = before
+	cmd = "~/.git-templates/hooks/jira_trailer.sh"

+ 7 - 0
dotfiles/gitconfig-personal

@@ -0,0 +1,7 @@
+# Ref:
+#	https://blog.hao.dev/how-to-use-different-git-emails-for-personal-and-work-repositories-on-the-same-machine
+
+[user]
+	email = "jeremy.mauro@gmail.com"
+	name = "Jeremy MAURO"
+	signingkey = FA2D8E280A6DD533

+ 6 - 0
dotfiles/gitconfig-work

@@ -0,0 +1,6 @@
+# Ref:
+#	https://blog.hao.dev/how-to-use-different-git-emails-for-personal-and-work-repositories-on-the-same-machine
+
+[user]
+	email = "jmauro@aviatrix.com"
+	name = "Jeremy MAURO"

+ 3 - 0
dotfiles/gitignore_global

@@ -0,0 +1,3 @@
+# Direnv stuff
+.direnv
+.envrc