FDE Times dataFDE jobs open 928▲21 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 85Companies hiring 200Remote-friendly 24%Median US pay $200kTop hirer Databricks 107
中文VI

The newspaper of the Forward Deployed Engineer

Guides

A commit with the wrong email costs more client trust than a bug

Five habits, from per-folder identities to respecting review rules, keep your first merge request on a client's internal GitLab from stalling.

ShareLinkedInFacebookX

In brief

  • One folder, one identity: includeIf gitdir means you never commit to a client repo with the wrong email.
  • Name remotes after the client and separate where you fetch from and where you push to; do not let everything be origin.
  • On a client machine, avoid the store helper, which writes passwords to a plain-text file that never expires; read CODEOWNERS before writing your first line of code.
Infographic on a timeline of four checkpoints a commit passes through at a client site. 01 Identity: do use includeIf per folder for each client, such as ~/clients/nganhang/; avoid a global user.email in client repos. 02 Remote, highlighted in orange as the scariest mistake: do rename origin to nganhang and name the remote explicitly on every push; avoid calling everything origin and pushing code to the wrong server. 03 Credential: do use the cache helper, which keeps credentials in memory and clears them after 15 minutes; avoid store, which writes a plain-text file that never expires. 04 Review rules: do read CODEOWNERS first and keep each MR to one owner group; avoid treating approvals as an obstacle and looking for a way around them. Closing quote: The repo isn't yours, but every commit still carries your name.
Four checkpoints on a commit's path at a client site: what to do and what to avoid. Source: Pro Git, git config, git remote and GitLab documentation, as cited in the article.

By Wednesday afternoon of the first week, the merge request is stuck: the Merge button is locked, and the commit history shows your personal email sitting next to the client company’s addresses.

Take a hypothetical first week at a bank. You are handed a laptop with software installation locked down, an account on the bank’s internal GitLab, and a repository with a dozen branches named after its regional offices. Nothing in that scenario is technically hard. Yet mistakes of this kind erode a client’s trust faster than a bug, because they show you have not yet understood their environment.

For an FDE, Git at a client site is an operational skill made up of five things: installing it on a machine you do not own, keeping your identity straight, managing several remotes, keeping credentials safe, and respecting the client’s review rules.

The client’s machine, the client’s rules

The first job is getting Git to run. Pro Git says that on Debian-based Linux distributions such as Ubuntu you use apt. On macOS Mavericks (10.9) and later, typing git in Terminal for the first time prompts the machine to install the Xcode Command Line Tools.

Windows is where people get stuck. The official build comes from Git for Windows, a project separate from Git itself, while the Chocolatey package is maintained by the community. On a client’s locked-down VM, ask IT which sources they allow before downloading anything, because pulling from the wrong source can turn into a security ticket.

If the client’s operating system ships with a very old Git, Pro Git notes that installing from source gets you the latest version. Treat that as a last resort, only when the client allows builds on their machines.

One folder, one identity

The most common mistake among people working for several clients is committing with a global user.email. The git config documentation describes exactly this situation: you can use different user.name and user.email values depending on the directory that holds the worktree, through includeIf with a gitdir condition.

The simplest layout is one folder per client. In ~/.gitconfig:

[user]
    name = Nguyen Van A
    email = [email protected]

[includeIf "gitdir:~/clients/bank/"]
    path = ~/clients/bank/.gitconfig

And in ~/clients/bank/.gitconfig:

[user]
    email = [email protected]

Every repository under ~/clients/bank/ now uses the email the client issued. Check it by cd-ing into a repository there and running git config user.email. The git config documentation uses this very kind of condition to apply a configuration to every repository inside a directory, so you only declare it once per client.

Whose origin is it?

When you clone from the client’s GitLab, the default remote is called origin. A few weeks later you add an internal repository from your own company to hold shared integration code, and origin starts to become ambiguous. Rename it from the start:

git remote rename origin bank
git remote add internal [email protected]:fde/connector.git
git fetch internal
git branch -r

According to the git remote documentation, rename also updates every remote-tracking branch and related configuration, so nothing needs fixing by hand. After git fetch internal, branches appear as internal/feature-x, kept apart from bank/feature-x.

The Git documentation offers another piece of advice worth remembering: if you fetch from one place and push to another, use two separate remotes. At a client site, this rule prevents the worst outcome, pushing the client’s code to your company’s server or the reverse. Before every push, type the remote name explicitly (git push bank feature/x) instead of letting Git guess.

In a repository with many branches for regional offices or sub-clients, clear remote names make git branch -r read like a map. The prefix alone tells you whose branch is whose.

Where does the password live on someone else’s machine?

By default Git does not store credentials, so every push over HTTPS asks for them again. The natural reflex is to enable the store helper, and on a client’s machine that is a mistake. Pro Git is explicit: store mode saves credentials to a plain-text file on disk and never expires them.

On a laptop or VM owned by the client, especially a shared one, such a file is a vulnerability with your name on it. A more sensible choice is the cache helper, which keeps credentials in memory and clears them after 15 minutes:

git config --global credential.helper cache

Re-entering them after every long break is a minor annoyance, but a far cheaper one than a security investigation. If the client has its own token policy, follow it.

Read the review rules before writing code

Back to the locked merge request. On GitLab, a client can turn on required approvals: according to the GitLab documentation, a merge request cannot be merged until it has enough approvals from the designated people. That is their process, not a fault.

The question is who has to approve. GitLab uses a CODEOWNERS file to determine reviewers file by file. If one merge request touches both the payments folder and the reporting folder, you may well need two different groups to sign off, and your MR will wait on the slowest of them.

So before creating a branch, open CODEOWNERS and find the lines matching the paths you plan to touch. Split your changes so each merge request needs only one owner group, and send that group a short message in advance about what is coming. A small MR, sent to the right people and introduced beforehand, usually moves faster than a large one landing in the inboxes of three teams.

The mistakes that keep recurring

The most frequent is committing to a client repository with a personal email, fixed with includeIf before the first line of code. Next comes leaving everything named origin and pushing to the wrong server. Then there is enabling store on a shared machine to avoid typing a password.

The last one is harder to spot: treating the client’s review process as an obstacle and looking for a way around it. Approvals and CODEOWNERS tell you who actually owns that code, which means they are the people you need to get to know early.

If you are preparing a CV for an FDE role, replace “proficient in Git” with something specific: “worked on a client’s internal GitLab with required approvals and CODEOWNERS, managing multiple remotes and per-client identities”. Have a short example ready for interviews about a time you split MRs by owner group.

At a client site, the repository is not yours, but every commit still carries your signature. Configuring things correctly from day one is the cheapest way to keep that signature trustworthy.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
5 sources
Read next on the roadmap · Stage 2: Broad engineeringOne retry at 2am can double your AI assistant's dataAirflow's own rule is that a task must give the same result however often it runs, and this four-task ELT pipeline is built to honour it.