git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Loredana TralliNext: Konstantin Khomoutov
Message 2 of 5 in “Ask for feature on git”
  1. Loredana TralliSep 3, 2024
  2. Simon RichterSep 3, 2024
  3. Konstantin KhomoutovSep 3, 2024
  4. Loredana TralliSep 4, 2024
  5. Konstantin KhomoutovSep 4, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.