When committing to a Git repository related to my consulting work, I must use my company e-mail address, firstname.lastname@example.org. Not so much for my open-source work – for this, I prefer to use other e-mail addresses, like email@example.com . (For example, Travis CI sends notification e-mails to the committer’s e-mail address, and I have set up filtering for that other address.)
Having to configure the e-mail address for each repository separately eventually gets annoying. Instead, I’d rather have all repos within a specific subdirectory use particular e-mail address.
All my Git repos live in
cynkra, contain R packages and repos related to consulting, respectively. To achieve the desired setup, I edit my
~/.gitconfig with the following entry:
[includeIf "gitdir:git/**"] path = git/.gitconfig
This ensures that all repos in the
git directory use the
git/.gitconfig file in addition to the main configuration. That file contains the following:
[includeIf "gitdir:R/**"] path = R/.gitconfig [includeIf "gitdir:cynkra/**"] path = cynkra/.gitconfig
~/git/cynkra/.gitconfig, I configure the e-mail addresses I want to use for all repos pertaining to
[user] email = ...
I verify the setup with
git config -l | grep user. Indeed, cynkra repos use the cynkra e-mail address. Voilà!
The above approach requires a recent-ish version of
git- version 2.14 or later should suffice. Read more about conditional includes.
Kirill Müllertsbox 0.3.1: extended functionality
Christoph SaxCelebrating one-year anniversary as RStudio Full Service Certified Partner
Cosima Meyer, Patrick SchratzDeprecating a pkgdown site served via GitHub Pages
Patrick Schratz, Kirill Müllergfortran support for R on macOS
Patrick SchratzSeasonal Adjustment of Multiple Series
Christoph SaxDynamic build matrix in GitHub Actions
Kirill MüllerSetting up a load-balanced Jitsi Meet instance
Patrick SchratzDevOps Expert (f/m/d, 60-100%)
cynkra teamMaintaining multiple identities with Git
Kirill MüllerRelational data models in R
Angel D'az, Kirill Müllertempdisagg: converting quarterly time series to daily
Christoph Saxtsbox 0.2: supporting additional time series classes
Christoph SaxDevOps System Engineer (40-60%)
cynkra teamIntroducing dm: easy juggling of tables and relations
Balthasar Sagertsbox 0.1: class-agnostic time series
Christoph SaxData Scientist/Engineer (40-100%)
cynkra teamTime series of the world, unite!
Christoph SaxDone “Establishing DBI”!?