Suppose I have my \"master\" branch checked out. I\'ve committed some production changes to \"master\", and now I want to rebase my \"experimental\" branch onto the latest m
Since git 2.5, an even better solution is to use a second worktree.
A git repository can support multiple working trees, allowing you to check out more than one branch at a time.
$ git worktree add ../second-copy experimental
$ cd ../second-copy/
$ git rebase master experimental
And that's it. Afterwards, you can rm -rf second-copy if you want, or keep it for more rebases in the future.
$ git rebase master experimental