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 :
- git clone is aborting due to possible repository corruption on the remote side even though memory settings are done properly
- Undo changes in working local folder from specific commit that already pushed
- git clone : no address associated with name
- GIT and GitHub - How can I tell who landed a commit into a repository?
- Is there a way to make Jekyll render pull request diffs?
- Permission Denied Github (push)
Then to see what happen, i run gitK command and i have :
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")
2 Solutions collect form web for “why git push origin master does not work?”
According to your
git status message, you are on branch
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
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:
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>
-uflag only adds files that have been updated, thanks to o11c for the tip!)
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"
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