Re: Ask for feature on git
- From
Simon Richter <simon.richter@hogyros.de>
- Date
- Sep 3, 2024, 13:33 UTC
- Message-ID
- <45a51124-7249-4678-a723-4ab9f82a5f2e@hogyros.de>
- In-Reply-To
- <CAEO06G+SLu-LAe0mkR3ZbaL0MZpBm9PhntQjF-YwVPMtnuH=rQ@mail.gmail.com>
Hi,
On 9/3/24 17:18, Loredana Tralli wrote:
> Is it possible to have a git command to find out which is the parent branch?
You can ask for the "upstream" branch of a given branch, using the "@{upstream}" syntax, that is documented briefly in the git-rev-parse(1) manual page.
The upstream branch is automatically set if you check out a branch name that only exists in a remote repository but not locally (then, a local branch is created), or explicitly set with "git branch --set-upstream-to".
Simon