Why does git think that the master is ahead of the console when it really stands?

I have a repo on GitHub where someone created a couple of new branches, and I clicked "merge" on the GitHub branches to merge them into master.

In the history of fixing GitHub I see four fixation man fixes on a branch ( hash1and hash2), followed by the merger of my ( hash3and hash4). This is normal.

But I am confused about the local git status and how to synchronize it with the remote one. I am in the master branch.

If I type git whatchanged, the latter commits that I see locally, are the people who commit on a branch ( hash1and hash2), rather than a remote merging ( hash3and hash4).

If I type git status, I see the following:

On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

git , hash1 hash2 ? , hash3 hash4?

git pull origin master, :

From github.com:myorg/myrepo
 * branch            master     -> FETCH_HEAD
Already up-to-date.

, hash3 hash4.

, , .. , ?

UPDATE: git remote -v:

origin  git@github.com:myorg/myrepo.git (fetch)
origin  git@github.com:myorg/myrepo.git (push)

git log --graph --decorate --pretty=oneline --abbrev-commit --all:

*   2315aed (HEAD -> master) Merge branch 'master' of github.com:myorg/myrepo
|\
| *   9de7505 (origin/master) Merge pull request #12 from myorg/reposition-video
| |\
* | \   0d1d845 Merge branch 'reposition-video' of github.com:myorg/myrepo
|\ \ \
| |/ /
|/| /
| |/
| * 1067905 (origin/reposition-video, reposition-video) Move the video below the fold.
* |   a5e8d96 Merge pull request #11 from myorg/update-install-docs
|\ \
| |/
|/|
| * 9744ffa Minor documentation fixes.
|/
* 4b4d507 Update README.
* 89da81b Add latest code for feature.

, , git log , , ! git whatchanged, , .

: , ? - , git pull ?

+4
2

master origin/master

git checkout master
git reset --hard origin/master

0d1d845 2315aed,

* 9de7505 (origin/master, HEAD -> master) Merge pull request #12 from myorg/reposition-video
|\ 
| * 1067905 (origin/reposition-video, reposition-video) Move the video below the fold.
* |   a5e8d96 Merge pull request #11 from myorg/update-install-docs
|\ \
| |/
|/|
| * 9744ffa Minor documentation fixes.
|/
* 4b4d507 Update README.
* 89da81b Add latest code for feature.

. , , " ",

git reset --hard 2315aed
+2

, - Git master , master, GitHub. :

Your branch is ahead of 'origin/master' by 1 commit.

, master . -, . , , , :

git checkout master
git pull origin master
# work work work
git commit
git status

, .

git pull origin master

master. , Git , , . , . master. GitHub, - .

+1

All Articles