2

Ubuntu 16.04

I know that I have organized a remote repository.

I can execute:

git add .
git commit -am "Savepoint"

Then I can check:

michael@Thinkpad:~/PycharmProjects/photoarchive_2$ git status
On branch master
nothing to commit, working directory clean

But I know that I'm ahead of origin.

I execute:

git push origin master

And now I can see my commit at the remote repository.

I expect git to show me the information like:

Your branch is ahead of 'origin/master' by 3 commits.

Could you tell me there is no such information shown?

ADDED LATER:

git show-branch -a
* [master] Started working with Image
 ! [origin/master] Started working with Image
--
*+ [master] Started working with Image
Michael
  • 4,273
  • 3
  • 40
  • 69

1 Answers1

2

Maybe you need to track the remote branch?

$ git branch --set-upstream-to=origin/master master

See this related question for details about --set-upstream. In short, it tells git what remote branch you push the local one to.

zoul
  • 102,279
  • 44
  • 260
  • 354
  • Tried git branch -vv * master 4995aeb Started working with Image So, it is the correct branch. And the only one. – Michael Jun 05 '17 at 08:40
  • Pardon. Maybe this is not the only one branch. I edited my question. Please, have a look at it (at the bottom of the question). – Michael Jun 05 '17 at 08:43
  • Even if your `master` is the only branch, you have only one `origin` remote and there’s also a `master` branch there, git doesn’t necessarily know that you wish to push your `master` to `origin/master`, so you have to tell it by using `--set-upstream` (or by adding `-t` when checking the remote branch out). – zoul Jun 05 '17 at 10:03