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 7192063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:51:40+00:00 2026-05-28T19:51:40+00:00

[edit: added command outputs as requested, and reorganized for clarity] I’ve got two clones

  • 0

[edit: added command outputs as requested, and reorganized for clarity]
I’ve got two clones of a particular repo checked out.

git log
commit e06424b5...
...
commit 557a0eb8...

shows the same thing in both, with same hash at the top.

git remote show origin

same in both

git branch
* master

still same in both

Now some differences.

From the ‘good’ clone:

git log origin/master..
commit e06424b5...

git show-ref HEAD
e06424b5... refs/remotes/origin/HEAD

# On branch master
nothing to commit (working directory clean)

From the ‘bad’ clone:

git log origin/master..
commit 557a0eb8...

git show-ref HEAD
557a0eb8... refs/remotes/origin/HEAD

git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.

This is different [correction: earlier I reported that this output was the same]. show-ref seems to indicate that this checkout is one commit behind, while status says it is ahead. But git reset --hard e06424b5 changes nothing.

When I ask the ‘bad’ clone what it thinks needs to be pushed:

git diff --stat origin/master

it shows the files that were part of the e06424b5 commit, but in fact the only reason this checkout even has those files is because I pulled them.

Anyone know how to make the checkout realize that there’s nothing for it to push?

[edit: here are some additional commands and their outputs from the ‘bad’ clone…]

git log --graph --decorate --oneline    
* e06424b (HEAD, master)
* 557a0eb (origin/master, origin/HEAD) 

git rev-parse origin/master
557a0eb

git rev-parse HEAD
557a0eb (the previous hash)
e06424b (the correct, most recent hash)
  • 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-05-28T19:51:41+00:00Added an answer on May 28, 2026 at 7:51 pm

    Considering your comments, it seems to me that you are actually working in a ‘detached head’ mode.

    The problem, is that your initial post implies that a branch is pointing to a specific place that you don’t want it to (This would be much more clear if you actually posted any of the output of the git commands you had run) in which case git reset –hard is what you would expect to do to fix this.

    But in fact it seems that HEAD is just pointing to somewhere you expect it to not be, git checkout is the command you use to fix where HEAD is pointing to. I’m assuming that there may be something blocking the checkout from working, which is why I’ve added –force.

    WARNING: using git checkout with the –force parameter may kill any uncommitted changes you have, or things of the like.

    git checkout --force master
    

    Assuming you have a master branch, it’s the one you want to checkout, and that it is in fact actually tracking origin/master, this should get you out of the pickle you have found yourself in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT : Accepted answer points out what my issue was. I added another answer
EDIT: I have added Slug column to address performance issues on specific record selection.
Edit: You can get the full source here: http://pastebin.com/m26693 Edit again: I added some
EDIT: Modified title and added update. UPDATE : We no longer believe this is
I have a piece of code: EDIT: The _penParams are initialized as the added
in C# I'd like to invoke the label edit of a newly added item
I'm trying to figure out how to run Python programs with the Command Prompt
EDIT The blank spaces were added by an obscure statement in the code, somewhere
EDIT I added in some error handling to my .vbs file and it is
Reading around, the svn:ignore command seems to work one of two ways: If the

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.