get_default_remote_for_push

Function get_default_remote_for_push 

Source
pub fn get_default_remote_for_push(repo_path: &RepoPath) -> Result<String>
Expand description

Tries to find the default repo to push to based on configuration.

remote.pushDefault

The remote to push to by default. Overrides branch.<name>.remote for all branches, and is overridden by branch.<name>.pushRemote for specific branches.

branch.<name>.remote

When on branch <name>, it tells git fetch and git push which remote to fetch from or push to. The remote to push to may be overridden with remote.pushDefault (for all branches). The remote to push to, for the current branch, may be further overridden by branch.<name>.pushRemote. If no remote is configured, or if you are not on any branch and there is more than one remote defined in the repository, it defaults to origin for fetching and remote.pushDefault for pushing.

Falls back to get_default_remote_in_repo.