I'm trying to figure out why magit is saying this. I created and checked out a branch array-of-tables
from master
, made a commit, then pushed it (using push current and choosing to push to origin/array-of-tables). I see on github that it was pushed, so why is magit saying it's unpushed? I tried pressing g
to refresh it, even quitting and going back into magit-status. I imagine I'm just interpreting this incorrectly, or I did something wrong.
2 Answers
I think this is a git issue. Your local branch is not tracking origin/array-of-tables
, it's tracking origin/master
. Depending on what you actually want, you can ask git to track the other branch (You can use b u
) or update origin/master
(e.g. by pushing to it).
-
Thanks, you were right! I must have gotten confused with the create branch prompts or something for it to have remained on master as the upstream. Commented Aug 7, 2015 at 18:55
Since this question was asked a few things related to this have changes (starting with v2.4
).
First of all instead of
Unpushed commits (1)
you would now see
Unpushed to origin/master (1)
Which should make this quite a bit more obvious.
Furthermore Magit now supports a push-remote in addition to the upstream branch. The upstream of some feature branch is the branch into which it should eventually be merged (not pushed to). Often the upstream is origin/master
. The push-remote is where you actually push to. To learn more about these remotes see the Branching node in the magit
info manual.
Configuring two "related branches" for each branch has many advantages. One advantage, which is relevant to this question, is that this makes it possible to show both the commits that have not made it into the mainline yet, as well as the commits which nobody else can see yet, because you haven't pushed them anywhere yet at all. E.g.
Unpushed to origin/master (5) # 5 not in mainline yet
Unpushed to my-fork/feature (2) # 2 of those 5 not at all pushed yet