Fundamentals 4 min read

Set Global and Local Git User Info and Separate Developers on a Shared Machine

Learn how to view and set Git's global and local user.name and user.email configurations, and follow step‑by‑step instructions to differentiate multiple developers sharing the same workstation by applying repository‑specific settings, ensuring clear commit history and accurate attribution.

Ops Development & AI Practice
Ops Development & AI Practice
Ops Development & AI Practice
Set Global and Local Git User Info and Separate Developers on a Shared Machine

When committing code in Git, the author name and email are taken from configuration settings that exist at two levels: global (user‑wide) and local (repository‑specific). These values are recorded in each commit and appear in the project history.

Global configuration

View global settings : run git config --global --list to list all global configurations for the current user on the machine.

Set global user name and email : use the commands git config --global user.name "Your Name" and git config --global user.email "[email protected]".

Local configuration

View local settings : inside a repository, run git config --list (without the --global flag) to see the settings that apply only to that repository.

Set local user name and email : execute git config user.name "Your Name" and git config user.email "[email protected]" within the repository to override the global values for that project.

Distinguishing multiple developers on a shared machine

Ensure the global configuration represents a generic machine identity or is left unchanged if not needed.

For each developer, set a local configuration in the repositories they work on:

Developer A runs git config user.name "Developer A" and git config user.email "[email protected]" in their repositories.

Developer B repeats the process with their own name and email.

By using repository‑specific (local) settings, Git can correctly attribute commits to the right person even when the same machine is used by multiple developers, keeping the commit history clear and accurate. Regularly checking the configuration with git config --list helps maintain correctness.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Gitglobalcommit attributionlocalshared workstation
Ops Development & AI Practice
Written by

Ops Development & AI Practice

DevSecOps engineer sharing experiences and insights on AI, Web3, and Claude code development. Aims to help solve technical challenges, improve development efficiency, and grow through community interaction. Feel free to comment and discuss.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.