Reputation: 6842
My typical workday involves reviewing other devs' code and fixing multiple bugs at once. Are there any methodologies to quickly checkout a branch without having to interrupt your work in the current branch?
I do this many times per day and frequently forget which step I'm on.
git stash
git checkout feature-b
git pull
... make some commits, etc ...
git push
git checkout feature-a
git stash pop
Edit: Multiple directories are cool, but I don't think it's necessarily the only way to solve this.
Upvotes: 2
Views: 456
Reputation: 51150
I would:
Work In Progress
commitI don't trust stashes enough to save work in them. I might just save a local config setting or something that isn't critical.
Upvotes: 0
Reputation: 1325155
A better workflow would be to use the git worktree
command, which allows you to checkout different branches (of the same repo cloned only once) in different folders.
That way, no more stash to do, only a pull in the right folder.
You current work in a given branch remains untouched, unmodified, while you are doing a review in another folder/branch.
Upvotes: 2