# Five Git config lines that remove weekly annoyances

> Global settings that fix upstream errors, prune stale refs, replay conflict fixes, auto-stash and prompt on typos.

Source: https://fullbytedeveloper.com/blog/git-config
Published here: 2026-11-09
Tested: 2026-11-08, Git 2.54

Five global config lines that remove annoyances you hit every week. Run them once and every repo on the machine gets them.

## Set up auto upstream

No more "has no upstream branch" on a new branch's first push [1].

```bash
git config --global push.autoSetupRemote true
```

You should see your push succeed on the first try for a new branch.

## Prune stale remote refs

Every fetch drops `origin/*` refs for branches deleted on the remote [2]. Your local branches stay.

```bash
git config --global fetch.prune true
```

You should see deleted remote branches disappear from `git branch -r` after your next fetch.

## Enable conflict replay

Git replays a conflict fix you already made [3]. Read the replayed result before you `git add` and commit.

```bash
git config --global rerere.enabled true
```

You should see "Recorded preimage" when you resolve a conflict, and "Resolved using previous resolution" the next time the same conflict appears.

## Auto-stash on rebase

Rebase stashes your uncommitted work and puts it back after [4]. The reapply can still conflict.

```bash
git config --global rebase.autoStash true
```

You should see "Created autostash" at the start of a rebase when you have uncommitted changes.

## Prompt on typos

Typo a command and Git asks "Run 'status' instead [y/N]?" [5].

```bash
git config --global help.autoCorrect prompt
```

You should see the prompt when you run something like `git stauts`.

## Check and undo

Check your global config:

```bash
git config --global --list
```

Undo one setting:

```bash
git config --global --unset rerere.enabled
```

Every output above is from my test on Git 2.54. Older Git? `push.autoSetupRemote` needs Git 2.37 or later and `help.autoCorrect prompt` needs 2.34 or later. Check with `git --version`.

These five settings are now active on every repo. The next time you push a new branch, fetch after someone deletes one, hit the same merge conflict twice, rebase with uncommitted work, or typo a command, Git handles it.

Send this to the friend who types git push and gets the no upstream branch error every week.

## Sources

1. [Git docs: push config](https://raw.githubusercontent.com/git/git/master/Documentation/config/push.adoc)
2. [Git docs: fetch config](https://raw.githubusercontent.com/git/git/master/Documentation/config/fetch.adoc)
3. [Git docs: rerere config](https://raw.githubusercontent.com/git/git/master/Documentation/config/rerere.adoc)
4. [Git docs: rebase config](https://raw.githubusercontent.com/git/git/master/Documentation/config/rebase.adoc)
5. [Git docs: help config](https://raw.githubusercontent.com/git/git/master/Documentation/config/help.adoc)
