Skip to content

Commit 684a42f

Browse files
committed
Move GitHub and GitLab configuration examples to separate files
1 parent deb0b89 commit 684a42f

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

.gitconfig-github

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ====================================================================
2+
# GitHub-specific Git configuration
3+
#
4+
# To use this example:
5+
# 1. Get your unique GitHub commit email: https://docs.github.com/en/account-and-profile/how-tos/email-preferences/setting-your-commit-email-address
6+
# 2. Copy this file next to your `~/.gitconfig` and replace email below
7+
# ====================================================================
8+
9+
[user]
10+
email = YOUR_GITHUB_ID+USERNAME@users.noreply.github.com

.gitconfig-gitlab

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ====================================================================
2+
# GitLab-specific Git configuration
3+
#
4+
# To use this example:
5+
# 1. Get your unique GitLab commit email: https://docs.gitlab.com/user/profile/#use-an-automatically-generated-private-commit-email
6+
# 2. Copy this file next to your `~/.gitconfig` and replace email below
7+
# ====================================================================
8+
9+
[user]
10+
email = YOUR_GITLAB_ID-USERNAME@users.noreply.gitlab.com

.gitconfig.example

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
# To use this example:
55
# 1. Save this file as ~/.gitconfig
66
# 2. Replace all PLACE_HOLDER values (e.g., YOUR_FULL_NAME)
7+
# 3. Repeat for .gitconfig-github and .gitconfig-gitlab as necessary
78
# ====================================================================
89

9-
# --------------------------------------------------------------------
10-
# BASE CONFIGURATION
11-
# --------------------------------------------------------------------
1210
[user]
13-
# Set your default full name for all commits.
11+
# Set your default name for all commits.
1412
name = YOUR_FULL_NAME
1513

1614
# CRITICAL: Prevents accidental system email exposure if no
@@ -23,14 +21,8 @@
2321
# the repository (e.g., work vs. personal, or GitHub vs. GitLab, etc.)
2422
# --------------------------------------------------------------------
2523

26-
# --- GitHub ---
27-
# https://docs.github.com/en/account-and-profile/how-tos/email-preferences/setting-your-commit-email-address
2824
[includeIf "hasconfig:remote.*.url:**/*github.com/**"]
29-
[user]
30-
email = YOUR_GITHUB_ID+USERNAME@users.noreply.github.com
25+
path = .gitconfig-github
3126

32-
# --- GitLab ---
33-
# https://docs.gitlab.com/user/profile/#use-an-automatically-generated-private-commit-email
3427
[includeIf "hasconfig:remote.*.url:**/*gitlab.com/**"]
35-
[user]
36-
email = YOUR_GITLAB_ID-USERNAME@users.noreply.gitlab.com
28+
path = .gitconfig-gitlab

0 commit comments

Comments
 (0)