-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate branches pointing to same upstream #2
Comments
When a branch has more than one upstream revision (ex: origin/master and origin2/master), `remote_branch_name` returns multiple references concatenated together causing the git error shown below: fatal: ambiguous argument 'origin/masterorigin2/master...HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' fatal: ambiguous argument 'origin/masterorigin2/master...HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' This patch just picks the first of the upstream branches. A full fix would allow the user to decide which upstream to track.
This also happens if you have some branch setup like following:
When working on My workaround in my case is: # in radar-base.sh -> remote_branch_name()
local remoteBranch="$(git for-each-ref --format='%(upstream:short)' refs/heads $localRef 2>/dev/null | grep origin/$localRef)" So, basically in the grep command prefix with (Unfortunately this breaks the nice branch diff output and stays on In general, if you have two or more branches sharing identical suffixes, git-radar will fail for the branch without the prefix. |
Use `git config` to get the correct upstream remote and branch when you have branch with the same name in multiple remotes (e.g. "origin/master" and "coworker/master"). Uses awk which may be a problem?
Use `git config` to get the correct upstream remote and branch when you have branch with the same name in multiple remotes (e.g. "origin/master" and "coworker/master"). Uses awk which may be a problem?
When you have two branches point to the same upstream branch you get the following message:
due to the
remote_branch_name
function having trouble finding which branch to followThe text was updated successfully, but these errors were encountered: