why git push origin master does not work?

I modify my local file. I commit locally and it’s ok. But when i push to github, i have the message that all things are update. Here is the command and its result :

git push origin master

I have the following error message :

Everything up-to-date

Then to see what happen, i run gitK command and i have :

enter image description here

I don’t understand why i am getting this error ? Why i cannot push my code to github ?

I run the command :

git status
On branch dev-branch
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

    modified:   deploy/openshift (modified content)

no changes added to commit (use "git add" and/or "git commit -a")

  • how to send somebody my (already generated) github public rsa key(send the key or the .pub file?)
  • Github Authentication
  • How do I learn the process of application development by cloning an open source project from github?
  • GitHub push not working (Connection Error)
  • Is it possible to reject a commit on Github if the commit isn't formatted correctly?
  • Git connect using ssh on windows
  • Git: Fork / Remote / Clone Concepts
  • GIT SSH is not Working
  • 2 Solutions collect form web for “why git push origin master does not work?”

    According to your git status message, you are on branch dev-branch not master.

    When you git push origin master the last parameter is the branch name. You have commits in a branch named dev-branch not in master, so pushing master does not have any changes to push.

    You probably either want to:

    git push origin dev-branch

    which would create the dev-branch branch on GitHub and push your code there, or..

    git checkout master
    git merge dev-branch
    git push origin master

    which would merge your changes from dev-master into master (so master would contain all your commits from dev-branch) then push master to GitHub.

    You are getting this message beacause you have unstaged changes.

    In order to push changes to the server you must follow these steps:

    1. Stage changes : This is when you tell git to track a certain file for changes. You can do this from the command line with : git add -u <filename>
      (the -u flag only adds files that have been updated, thanks to o11c for the tip!)

    2. Commit changes : Once you have added all the files to the stage you need to save them locally with git commit -m "A commit message here"

    3. Push to server : Now run git push origin master

    Do everything in one step:

    # This adds all updated files in current folder to the stage, 
    # then commits with message  and pushes to server
    $ git add -u .; git commit -m "[YOUR MESSAGE HERE]"; git push origin master
    Git Baby is a git and github fan, let's start git clone.