It used to be that every time I created a new feature branch with Magit, I would do this in the Magit buffer:
- Fetch from all remotes (
f a
) - Change to my local
master
branch (b b master RET
) - Rebase that branch on the remote master branch (
r u
) - Create a new feature branch based on my local master branch (
b c master RET feature RET
).
I didn't use my local master branch for anything other than spinning off new branches. Eventually I thought, hey, I can make this process shorter by just creating a new branch based on the remote branch:
- Fetch from all remotes (
f a
) - Create a new branch based on the remote master branch (
b c origin/master RET feature RET
)
That would be great, except that the new branch now has origin/master
set as its remote tracking branch. I'd rather have it be created with no remote tracking branch, so that when I eventually push, I'll be prompted for the obvious remote branch name origin/feature
and just accept that. So I need one more step:
- Unset the remote tracking branch (
b u
)
I'd rather not have to do this every time. Is there some way to create a new branch based on a remote branch without also making the remote branch a tracking branch? I've pored through the Magit docs and searched online without success. The only thing I found to try is this:
(setq magit-branch-adjust-remote-upstream-alist '((nil . "master")))
...but the docs for that variable don't suggest that nil
is an acceptable upstream, and indeed, this doesn't work.