From: Konstantin Khomoutov <kostix@bswap.ru>
To: Loredana Tralli <loredana.tralli@gmail.com>
Cc: Simon.Richter@hogyros.de, kostix@bswap.ru, git@vger.kernel.org
Subject: Re: Ask for feature on git
Date: Wed, 4 Sep 2024 17:55:44 +0300 [thread overview]
Message-ID: <20240904145544.xi7rez4hvbfcx57l@carbon> (raw)
In-Reply-To: <CAEO06GKzQTfm9z8ODCAYdHsWwgfHau0kuFA7WFkVqkPHbsm_1g@mail.gmail.com>
On Wed, Sep 04, 2024 at 03:59:33PM +0200, Loredana Tralli wrote:
[...]
> and I'd like to know if there is a command through bash to check
> directly "you created branch test from branch release".
This is quite possible: Git has a command, `git merge-base`, which can be used
to figure out the relation between two branches you're interested in.
In particular, a call
$ git merge-base --fork-point test release
should print the SHA-1 name of the last commit both branches share with each
other (before their histories have diverged) and exits with status code 0.
Otherwise ("test" was not forked off "release") the command would print
nothing and exit with status code 1.
I would suggest to read [1] to get better understanding of what it does.
1. https://www.git-scm.com/docs/git-merge-base
prev parent reply other threads:[~2024-09-04 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 8:18 Ask for feature on git Loredana Tralli
2024-09-03 13:33 ` Simon Richter
2024-09-03 17:04 ` Konstantin Khomoutov
2024-09-04 13:59 ` Loredana Tralli
2024-09-04 14:55 ` Konstantin Khomoutov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240904145544.xi7rez4hvbfcx57l@carbon \
--to=kostix@bswap.ru \
--cc=Simon.Richter@hogyros.de \
--cc=git@vger.kernel.org \
--cc=loredana.tralli@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox