Re: Ask for feature on git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux