Skip to content

Problem using Git basic commands - push #22054

Discussion options

You must be logged in to vote

Each branch in a git repository can have a remote “upstream” branch (also called “tracking” branch). If you do a git pull or git push (force or not) without further parameters it will pull from or push to there. The error message says that your local master branch doesn’t have a configured upstream branch.

If you want to set origin/master as the upstream branch for your local master, you can just use the command suggested by the error message, and add --force for the force-push:

git push --force --set-upstream origin master

If you don’t want to set the upstream branch leave out the --set-upstream option.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant