简体   繁体   中英

How to determine your default remote git repository?

How can I see the default remote repository set on my Pycharm? I want to know when I type git push without specifying the repository name, which of my remote repository is going to be updated, assuming that I have added multiple remote repository with different alias names.

For viewing the default upstream repository you can use git config --edit .

This shows you how your git repository is set up.

Under the branch you want to check the remote of, there is a line: remote = example . Look for the remote name in that file and you can find out where everything will be sent/pulled from.

To answer the first question, it depends mainly on the setting of your remote repository.

On some third-party websites like github or bitbucket, you can set some branches as " protected ", meaning that any push will be rejected on them, forcing anyone to use pull requests to merge anything in.

Out of this constraint, you can push to any branch, master or not. In this case, you indeed merge locally then push to remote.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM