On Sat, 27 Apr 2013 23:11:18 -0700 (PDT)
Alexey Ganzha <tret...@gmail.com> wrote:

> In my local repo i see list of ALL commits as response to
> git log master ^origin/master
> and
> git log origin/master..HEAD
> But all commits are pushed allready and they are present in remote
> repo. Everything works fine, except i always see looooong list of
> unpushed commits in my magit status screen.
> Is it possible to fix it?

My take on this is that your branch "master" is not set to track the
remote branch "origin/master" and so the usual Git magic of updating
origin/master when you do `git push origin master` is not engaged.

There are two fronts on which you should correct this:

1) Make "master" track "origin/master":

   In recent enough Git, while having "master" checked out:

   git branch -u origin/master

   In older versions of Git:

   git branch --set-upstream master origin/master

   Or you can even do

   git push -u origin master

   which would set "master" to track "origin/master" as a by-product
   of the push operation (and also update "origin/master" -- see below).

2) Actually update "origin/master" with commits pushed from local
   "master" to "master" in the remote repo.

   A simple `git fetch origin` would do that.

   The `git push -u origin master` encantation would do the same, just
   using the local commits.

Most commonly a situation like this occurs when you create a branch
locally, then push it to a remote repository (creating a brand new
branch there) but forget to tell Git you want this branch to actually
track the state of that branch in the remote repo.  IMO, the simplest
way to tackle this is to use `git push -u <repo> <branch>` for such a
initial "creative" push of a newborn branch.

A nice bonus of having proper tracking setup is that `git status` and
other chatty operations will now show you how the current state of your
tracking branch relates to the state of branch it tracks, like "master
is 2 commits ahead of origin/master" hinting you that you have unpushed

Reading [1] is a must.

1. http://git-scm.com/book/en/Git-Branching-Remote-Branches

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to