git -C
A Git option that runs the command as if you had first changed into the given directory.
In more detail
git -C work config user.email reads the setting of the repository in the work folder without leaving the one you are in. It is handy for scripts and for comparing two repositories side by side.
Example
git -C personal config --show-scope user.emailRelated terms
- git config — The command that reads and writes Git settings, which live in plain text config files.
Taught in
- Installing Git, And Telling It Who You Are — Advanced Git Internals & Distributed Workflows
- What A Commit Really Is — Advanced Git Internals & Distributed Workflows
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows
- What A Remote Actually Is — Advanced Git Internals & Distributed Workflows