Why I always Got Error “Push to origin/master was rejected”?

I’m not sure what exactly you’re asking here. And those logs are not very helpful.

But since you’re asking about pushing…

Generally you’ve started out by cloning a repo or you’ve run git init and created one.

You then edit or create files in that repo.

You then need to stage those file to be committed.

git add <file1> <file2> ...

You can see what’s been staged with git status

If everything looks good you can commit those changes

git commit -m "My commit message"

If you’ve cloned a remote repository, and you have permissions to push to it

git push <remote> <branch> so something like git push origin master

You can view your remotes with git remote -v

You can add a remote if you don’t see the remote you need in the list git remote add <give it a name> <the URL to the repo> so something like git remote add upstream https://github.com/me/myrepo.git

And then push to it git push upstream master

Git for Windows: https://git-scm.com/download/win
The reference manual: https://git-scm.com/doc
Here’s a how to: https://githowto.com/

[Update]
Those logs are better. Line 5 is telling you what you need to do. git pull
Some one must have pushed changes before you did. So you need to pull those changes into your repo. fix any conflicts, commit, and push.

Leave a Comment