I'm trying to figure out whether I can pull.
If my branch is based on a remote branch than he has remote tracking branch, so I can pull.
If my branch is based on a commit, it doesn't have a remote tracking branch thus pull would fail.
What I managed to find is that when using the command git branch -vv
:
- If there's a remote tracking it will be shown in square brackets. Example:
* origin/before-yo b0b97cf [remotes/origin/before-yo] Move to subfolder
- If the branch is based on a commit, there won't be any remote ref indication. Example:
* 2fbe2ab473fe8f7aea2a36642aea1dc7d36add51 2fbe2ab Advance counter
Is there a better way to understand if there's a remote tracking branch connected to my current working branch?
Also, might git branch -vv
not work in some cases?
Thanks.