Use git worktree to work with multiple branches
This post is about the awesome git worktree, that simplified my personal workflow with git very much. In the past I had at least 2 versions of repository checked out locally or fiddled around with git stash to find a thing I did weeks ago. But let’s talk about how I use git and how git worktree helped me. Use Cases When I’m reviewing a Pull or Merge Request, sometimes I would like to see the code in my own IDE instead of the GitLab or GitHub UI. Normally I have a single clone of a repository on my local machine and I’m in the process of adding new features or fixing a bug myself. So I don’t want to commit things just yet, but just check out another branch. I know I could use git stash or create a WIP commit and then amend by providing a good commit message later, but almost all the time I forget about my existing stash or the earlier WIP commit. ...