Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:57:47+00:00 2026-06-12T01:57:47+00:00

git: Your branch is Ahead by X commits Git branch is ahead of origin/master

  • 0

git: Your branch is Ahead by X commits

Git branch is ahead of origin/master

I have read both questions above and it still does not answer my questions. Basically what I did was

  1. Create a new repository in GitHub.
  2. Clone and get the data in my local linux box
  3. Make changes do “git add” then do a “git commit -m “message”
  4. Finally do a “git push https://github.com/username/sandbox.git“. This works fine and I use the https protocol that is advised instead of the SSH protocol (Please note if I do just “git push” it uses the SSH protocol which I have not configured yet and it fails)
  5. Perform “git pull https://github.com/username/sandbox.git” and also “git fetch https://github.com/username/sandbox.git” all of which performed successfully saying “Already up-to date”.
  6. Visit the github website and I can see the changes.
  7. Now run “git status” and I now see the following

    On branch master
    Your branch is ahead of ‘origin/master’ by 9 commits.

This was not what I expected. Can someone tell me why git thinks I am ahead of the origin/master by 9 commits. I have pushed and pulled the data so I would expect my local repo to be in perfect sync with the remote master/origin repo.

The command “git branch -av” shows the following

 * master                a99daf0 [ahead 9] submit
  remotes/origin/HEAD   -> origin/master
  remotes/origin/master 81c7ec1 remove out files
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:57:48+00:00Added an answer on June 12, 2026 at 1:57 am

    As a newbie what I actually needed was the answer described by “Mims H Wright” at How can I find the location of origin/master in git, and how do I change it? which eventually points to the link http://fvue.nl/wiki/Git%3a_Your_branch_is_ahead_of_the_tracked_remote_branch.

    Basically I had to do

    git push origin master:master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've done a fair bit of work (Your branch is ahead of 'origin/master' by
git version 1.7.3.5 I have the following branches: git branch image master * video
I am on a master branch 'master' and I have 1 commit ahead I
I have made commits to my local branch (let's just say master) and have
I have done the following: git add <filenames> git commit git push origin master:mybranch
Assume you have a file which has been committed in your Git repo. You
How do you list your commits along with their SHA1 values in git?
Possible Duplicate: git push error '[remote rejected] master -> master (branch is currently checked
I have a local branch that I created via git branch --track <localFeatureBranch> <remoteSVNBranch>
We have a problem/misunderstanding with our current git setup. We have local master and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.