proomt

Search

Search posts, papers, and topics

All posts

CodeshipStephen Connolly1 min readintermediate

Today I Learned: .gitconfig's includeIf

Summary

Use Git's `includeIf` conditional includes to automatically load per‑directory `.gitconfig` files, letting you set different `user.email` and `signingkey` values for Apache, work, and personal repos without manual `git config` calls.

  • Git supports conditional includes via `includeIf "gitdir:<path>"` to load extra config files based on the repository location.
  • Store per‑context identity settings (email, GPG signing key) in separate config files and reference them from `~/.gitconfig`.
  • Organise your code checkout directories (e.g., `~/apache/` for Apache projects, `~/src/` for work) so the `gitdir` pattern matches correctly.
  • This approach eliminates the need to remember to run `git config user.email …` for each repo.

Consistent author identity is required for auditability, proper attribution, and GPG‑signed commits. Automating the selection of email and signing key reduces human error and streamlines workflow across multiple organizations.

6/10

Related reading

  1. Reinventing issue tracking: Local-first and Git-native

    A devlog describing how Manganin’s issue tracker stores issues in a dedicated Git repo as plain files, after rejecting earlier approaches that tried to embed issue data in the code tree or Git refs. The author explains the pitfalls of using refs for issue storage, shows the low‑level Git commands needed for that approach, and then outlines the final design: a hidden sister repository where each i…

    Lobstersmanganin.dev6 minHN1lobste.rs27
  2. Inside ZCode: Silently uploading your Git history to the cloud

    ZCode (Zhipu’s AI coding desktop) silently archives your entire workspace—including full .git history, LFS cache, and config—encrypts it with a server‑supplied RSA public key, and uploads the ciphertext directly to Aliyun OSS. The upload runs unconditionally for any logged‑in user, cannot be disabled via UI, and the decryption key lives only on the server, giving Zhipu full read access to your co…

    Hacker News front pageferstar.org6 minpostmortemHN336113
  3. Beyond jj: config & tools ecosystem

    A talk‑style overview of the growing jj ecosystem, covering new built‑ins (bookmark‑advance, bisect‑run, run, fix, tag, arrange, converge), clever alias tricks (subcommand aliases, git‑push‑like publish alias), the community‑maintained alias directory, and current forge integrations (GitHub stacked PRs, JJHub, Radicle, Tangled).

    Lobstersarko.net16 mintalklobste.rs89