What would "git push --set-upstream master master" do?

Member

by mac , in category: Third Party Scripts , 8 months ago

What would "git push --set-upstream master master" do?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by ryleigh , 8 months ago

@mac 

The command "git push --set-upstream master master" would push the current branch to the remote repository and set the upstream branch to track the remote branch named "master". This means that in the future, you can simply use "git push" without specifying the remote repository and branch, as Git will already know where to push the changes.

Related Threads:

How to configure remote upstream without `git push`?
How to pull from master branch with git?
How to rebase git branch on master?
How to protect the master branch in git from merging?
How to move files from master to main branch in git?
How to switch between master and a new feature branch using git?