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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:25:44+00:00 2026-05-11T20:25:44+00:00

I have a remote gitosis server and a local git repository, and each time

  • 0

I have a remote gitosis server and a local git repository, and each time I make a big change in my code, I’ll push the changes to that server too.

But today I find that even though I have some local changes and commit to local repository, when running git push origin master it says ‘Everything up-to-date’, but when I use git clone to checkout files on the remote server, it doesn’t contain latest changes. And I have only one branch named “master” and one remote server named “origin”.

PS:
This is what git displays when running ls-remote, I’m not sure whether it helps

$ git ls-remote origin
df80d0c64b8e2c160d3d9b106b30aee9540b6ece        HEAD
df80d0c64b8e2c160d3d9b106b30aee9540b6ece        refs/heads/master
$ git ls-remote .
49c2cb46b9e798247898afdb079e76e40c9f77ea        HEAD
df80d0c64b8e2c160d3d9b106b30aee9540b6ece        refs/heads/master
df80d0c64b8e2c160d3d9b106b30aee9540b6ece        refs/remotes/origin/master
3a04c3ea9b81252b0626b760f0a7766b81652c0c        refs/tags/stage3
  • 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-11T20:25:45+00:00Added an answer on May 11, 2026 at 8:25 pm

    Are you working with a detached head by any chance?

    As in:

    detached head

    indicating that your latest commit is not a branch head.

    Warning: the following does a git reset --hard: make sure to use git stash first if you want to save your currently modified files.

    $ git log -1
    # note the SHA-1 of latest commit
    $ git checkout master
    # reset your branch head to your previously detached commit
    $ git reset --hard <commit-id>
    

    As mentioned in the git checkout man page (emphasis mine):

    It is sometimes useful to be able to checkout a commit that is not at the tip of one of your branches.
    The most obvious example is to check out the commit at a tagged official release point, like this:

    $ git checkout v2.6.18
    

    Earlier versions of git did not allow this and asked you to create a temporary branch using the -b option, but starting from version 1.5.0, the above command detaches your HEAD from the current branch and directly points at the commit named by the tag (v2.6.18 in the example above).

    You can use all git commands while in this state.
    You can use git reset --hard $othercommit to further move around, for example.
    You can make changes and create a new commit on top of a detached HEAD.
    You can even create a merge by using git merge $othercommit.

    The state you are in while your HEAD is detached is not recorded by any branch (which is natural — you are not on any branch).
    What this means is that you can discard your temporary commits and merges by switching back to an existing branch (e.g. git checkout master), and a later git prune or git gc would garbage-collect them.
    If you did this by mistake, you can ask the reflog for HEAD where you were, e.g.

    $ git log -g -2 HEAD
    

    While git push says "everything up-to-date", you still can technically push a detached HEAD, as noted in the comments by Jonathan Benn

     git push origin HEAD:main
    

    You have to specify the destination branch, since the source is not a branch, and does not have an upstream target branch.

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

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The short answer is no, a ClientDataSet is not thread… May 11, 2026 at 11:50 pm
  • Editorial Team
    Editorial Team added an answer Ok, actually, I guess that's the answer in my comment… May 11, 2026 at 11:50 pm
  • Editorial Team
    Editorial Team added an answer The std::exception class is defined as: namespace std { class… May 11, 2026 at 11:50 pm

Related Questions

The post aims to summarize all pieces of information to set up a closed
I have a remote EJB with a method that validates an object (returning true
I have a remote server that hosts my subversion repository on a non-standard ssh
I have a remote Git repository, and I need to roll back the last

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.