From 0f2295c4b921e9caa8cfeb8ee593039b48122856 Mon Sep 17 00:00:00 2001
From: ramsayleung
Date: Sun, 7 Apr 2024 21:25:51 +0000
Subject: [PATCH] deploy: 616b69b0333b57b4efce0468d84f4f5e654309e3
---
en/archives/index.html | 2 +-
en/categories/git/index.html | 6 ++
en/categories/git/index.xml | 62 ++++++++++++++++++
en/categories/git/page/1/index.html | 1 +
en/categories/index.html | 2 +-
en/categories/index.xml | 22 ++++++-
en/categories/til/index.html | 6 ++
en/categories/til/index.xml | 62 ++++++++++++++++++
en/categories/til/page/1/index.html | 1 +
en/index.html | 7 +-
en/index.json | 2 +-
en/index.xml | 48 +++++++++++++-
en/page/2/index.html | 5 +-
.../2024/git_conditional_configs/index.html | 25 +++++++
en/post/2024/github_summary/index.html | 3 +-
en/post/index.html | 7 +-
en/post/index.xml | 47 ++++++++++++-
en/post/page/2/index.html | 5 +-
en/sitemap.xml | 49 +++++++++-----
en/tags/git/index.html | 6 ++
en/tags/git/index.xml | 62 ++++++++++++++++++
en/tags/git/page/1/index.html | 1 +
en/tags/index.html | 2 +-
en/tags/index.xml | 42 ++++++------
en/tags/til/index.html | 6 ++
en/tags/til/index.xml | 62 ++++++++++++++++++
en/tags/til/page/1/index.html | 1 +
ox-hugo/conditional_config.png | Bin 0 -> 99259 bytes
sitemap.xml | 2 +-
29 files changed, 486 insertions(+), 60 deletions(-)
create mode 100644 en/categories/git/index.html
create mode 100644 en/categories/git/index.xml
create mode 100644 en/categories/git/page/1/index.html
create mode 100644 en/categories/til/index.html
create mode 100644 en/categories/til/index.xml
create mode 100644 en/categories/til/page/1/index.html
create mode 100644 en/post/2024/git_conditional_configs/index.html
create mode 100644 en/tags/git/index.html
create mode 100644 en/tags/git/index.xml
create mode 100644 en/tags/git/page/1/index.html
create mode 100644 en/tags/til/index.html
create mode 100644 en/tags/til/index.xml
create mode 100644 en/tags/til/page/1/index.html
create mode 100644 ox-hugo/conditional_config.png
diff --git a/en/archives/index.html b/en/archives/index.html
index fc039efd..c91592c1 100644
--- a/en/archives/index.html
+++ b/en/archives/index.html
@@ -1,6 +1,6 @@
Archive | In Pursuit of Hubris
Rewind your Github summary January 1, 2024 · 2 min · 241 words · Ramsay Leung
How to share resource between CDK stacks June 28, 2023 · 4 min · 683 words · Ramsay Leung
Topological Sort May 22, 2022 · 5 min · 874 words · Ramsay Leung
How To Design A Reliable Distributed Timer August 5, 2021 · 9 min · 1845 words · Ramsay Leung
Let’s make everything iterable April 29, 2021 · 5 min · 1004 words · Ramsay Leung
Serde Tricks December 13, 2020 · 10 min · 2007 words · Ramsay Leung
rspotify has come to async/await February 28, 2020 · 3 min · 432 words · Ramsay Leung
+git config --global user.name "Ramsay Leung"
+ git config --global user.email ramsayleung@gmail.com
+
The above command will simply add the user.name
and user.email
value into your ~/.gitconfig
file
+> cat ~/.gitconfig
+ [ user]
+ name = Ramsay Leung
+ email = ramsayleung@gmail.com
+ [ core]
+ quotepath = false
+ [ init]
+ defaultBranch = master
+
You could also specify --local
argument to writes the config values to .git/config
in whatever project you’re currently in.
+If you need to simultaneously contribute to your work and open source project on the same laptop, with different Git config values, e.g.(company email address for work-specific projects, personal email address for open source project), what should you do?
+You could definitely set up work-specific config as global config, then set up personal config with --local
for every personal project separately. It works, but tedious and easy to mess-up.
+Fortunately, starting from Git version 2.13, Git supports conditional configuration includes, you are capable of setting up different configs for different repositories.
+If you add the following config to your global config file:
+[ includeIf "gitdir:~/projects/oss/" ]
+ path = ~/ . gitconfig-oss
+
+ [ includeIf "gitdir:~/projects/work/" ]
+ path = ~/ . gitconfig-work
+
Then Git will look in the ~/.gitconfig-oss
files for values only if the project you are currently working on matches ~/projects/oss/
.
+Caution : If you forget to specify the “/” at the end of the git dir, e.g. “~/projects/oss”, Conditional Config won’t work!
+Therefore, you could have a “work” directory and work-specific config here and an “oss” directory with values for your open source projects, etc.
+
+
+
+
+Git also supports other filters more than gitdir
, you could specify a branch name as an include filter with onbranch
+ ; include only if we are in a worktree where foo-branch is
+ ; currently checked out
+[ includeIf "onbranch:foo-branch" ]
+ path = foo . inc
+
Check out the Git docs for more details
+]]>
+
+
+
+
diff --git a/en/categories/git/page/1/index.html b/en/categories/git/page/1/index.html
new file mode 100644
index 00000000..1f3f2efa
--- /dev/null
+++ b/en/categories/git/page/1/index.html
@@ -0,0 +1 @@
+https://ramsayleung.github.io/en/categories/git/
\ No newline at end of file
diff --git a/en/categories/index.html b/en/categories/index.html
index f591f349..083c4f14 100644
--- a/en/categories/index.html
+++ b/en/categories/index.html
@@ -1,5 +1,5 @@
Categories | In Pursuit of Hubris
-