Git Tips Slides
PageUp x2: previous · PageDown x2: next · Home: index

One directory per PR

Imagine you work on one Git repo and there are three PRs. These PRs stay open for several days, so constantly running git switch gets annoying.

The solution is simple: create several copies of your Git repo. Imagine your repo is called foo.

Then check out that repo four times:

  • foo-main
  • foo-pr-one
  • foo-pr-two
  • foo-pr-three

If you use VS Code, you can give each directory a different border color:

{
  "workbench.colorCustomizations": {
    "statusBar.background": "#00ff51",
    "titleBar.activeBackground": "#00ff51",
    "titleBar.inactiveBackground": "#00ff51"
  }
}

That makes it easier to switch between PRs.

If you have a train of PRs, I like this mnemonic to remember the order:

  • First PR: light blue (like "baby")
  • Second PR: yellow (like "youth")
  • Third PR: purple (like elderly)