Replies: 1 comment 1 reply
-
|
Thanks for the info! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As I'm expanding my git skills, I've recently started to look into git worktrees.
Rather than switching between branches (which requires you to commit any outstanding work), it's easy to create a whole new working tree in which a given branch is checked out.
git statusand git bash's custom prompt understand this as well.Notes:
Robot-2026-Codedirectory, I useThis will create a working tree in
../22-program-hood, make a local branch by the same name, and have that branch track the origin branch. (This is what you normally want, not sure why git made this so complicated.) Without the-b, it will not create a local branch and you'll be in detached head state.will create both the directory and a local branch
xbranchthat you can then push upstream in the usual way.(Note that just nuking the directory will leave some metadata behind.)
Beta Was this translation helpful? Give feedback.
All reactions