Skip to content

git#

Git Worktree: Work on Another Branch Without Leaving the Current One

You need a change on another branch, but the current one is busy: edited files, a running test, a terminal in the right folder. Stashing and switching loses all of that. A second clone copies the history and needs its own remotes.

A worktree is the middle ground: one more folder, the same .git.

add -> edit -> commit -> remove    branch kept, your checkout untouched

Different ssh keys for different github.com accounts

It might be a common case that you have multiple github.com accounts (personal and professional), and you want to use different ssh keys for different github accounts, as github.com does not allow same ssh key for different accounts with "Key is already in use" error.

To achieve this, you could follow this tutorial: