'git status' shows changes to be commited, but 'git push origin master' says 'Everything up-to-date'

I had some conflicts between my local repo and the remote repo.

So, I did:

  • How can merge conflicts be avoided when different methods (etc.) are added at the same location?
  • Git: resolving merge conflicts
  • Django South migration conflict while working in a team
  • git revert several specific commits
  • Git - how to force merge conflict and manual merge on selected file
  • Why does Git remember and use a conflict resolution from an aborted rebase without asking me?
  • git stash
    git pull origin master
    git stash apply
    
    // here i had merge conflicts, so i edited the files and did
    git add file1
    git add file2
    
    git commit
    

    Now when I do git status it shows a bunch of modified files, etc.
    But git push origin master says Everything up-to-date.

    Any ideas?

  • Merge an independent project into a greater one without losing history
  • What are the benefits of using git submodule
  • How to get certain commit from GitHub project
  • GitKraken won't push to new remote (“Select remote branch to push/pull with 'master': ”)
  • Untracked files show up after failed git pull
  • Exporting the change log from a commit on GitHub
  • 5 Solutions collect form web for “'git status' shows changes to be commited, but 'git push origin master' says 'Everything up-to-date'”

    If git status is showing modified files, those aren’t going to be pushed because they’re not committed yet. git status only shows changes that haven’t yet been committed (even if they have been staged).

    Try committing again and see if there are any error messages when you go to commit. (You may also need to git add files that didn’t have merge conflicts, if they were affected by whatever your popped from your stash – stashing doesn’t save stage state.)

    Did your commit actually succeed? If you had indeed made a commit since you pulled, pushing back to origin would have to push that commit. It sounds like you haven’t. The fact that git status shows modified files still is another sign that you haven’t – ideally, you’d end up with a clean tree after commmitting; git status would show “nothing to commit”. If they’re still showing up as modified, they haven’t been committed yet.

    Two things:

    1. First, have you done ‘git add .’ and ‘git commit -a’, just to be sure you’ve actually gotten everything and added everything?
    2. You may wish to try switching your autocrlf – ‘git config core.autocrlf true’, ‘git config core.autocrlf false’ and so on, doing a ‘git status’ in between each one. I run into this problem all the time.

    This might go without saying, but just to be explicit, make sure your local branch is ‘master’. When you run git status look to see which branch you’re on. If, for example, you created a branch called ‘foo’ and are currently on that branch you’ll have to run this command to push your current ‘foo’ branch to the remote ‘master’ branch:

    git push origin foo:master
    

    You can do first git commit -a -m “any message after change file”

    Then do git push origin master and then your changes will reflect in remote repo too.

    Git Baby is a git and github fan, let's start git clone.