Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3932012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:24:35+00:00 2026-05-19T23:24:35+00:00

My git repository has three branches, devel , stable and customers/acme_patches . A long

  • 0

My git repository has three branches, devel, stable and customers/acme_patches. A long time ago, stable was forked from devel, and all the bugfixing takes place in stable. Every now and then, stable is merged back into devel. customers/acme_patches is a branch with a few customer-specific patches. The branch wasn’t merged into either of devel and stable.

A bit of ASCII art to illustrate the scenario:

            o---o---o          customers/acme_patches?
           /
  o---o---1---o---o---o        stable
 /     \           \
o---o---o---2---o---o---o---o  devel
             \
              o---o---o        customers/acme_patches?

Now I wonder:

What branch was customers/acme_patches forked from – devel or stable? I only know that it was forked off one of them in the past, but I don’t know which. E.g. it might have been commit 1 or 2 in the above diagram.

I’ve been playing around with git log --oneline --graph and gitk but since customers/acme_patches was forked a few hundred commits ago, it’s hard to follow the lines being drawn.

Is there maybe a quick command (a little script is fine, too) which can somehow follow the commits in customers/acme_patches backwards to find the first commit with two children (the fork point) and then determines whether that commit was done in stable or in devel?

In the best case, I could just execute something like (excuse the prompt, I’m on Windows):

C:\src> git fork-origin customers/acme_patches
stable
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:24:35+00:00Added an answer on May 19, 2026 at 11:24 pm

    Well, there is probably no perfect solution to this answer. I mean there is no fork-origin equivalent in git (to my knowledge).
    Because the stable branch is merged into devel, your acme_patches (from 1) is on both devel and stable branch.

    What you could possibly do is:

    git branch --contains $(git merge-base customers/acme_patches devel stable)
    

    If you have stable and not devel, or devel and not stable, then you know where it comes from.

    For example, in the case 2, you would have

    $ git branch --contains $(git merge-base customers/acme_patches devel stable)
    customers/acme_patches
    devel
    

    while in case 1 you would have

    $ git branch --contains $(git merge-base customers/acme_patches devel stable)
    customers/acme_patches
    devel
    stable
    

    As it’s now on both branches (because of the merge from stable to dev)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two branches in my Git repository: master seotweaks (created originally from master
I have a git repository and two branches master and st (branched from master
My git repository has 2 branches: master and develop. I want a script that
My git repository has ~2,000 commits. For educational purposes, I have been playing around
Assume my git repository has the following structure: /.git /Project /Project/SubProject-0 /Project/SubProject-1 /Project/SubProject-2 and
I've got a Git repository that has some files with DOS format ( \r\n
my co-worker has just create a new branch in the git repository which we
Suppose I have Git repository like this: git-repo/ directory_1/ directory_2/ directory_3/ This has a
Say I have a project in a git repository. The project has a branch
Suppose I have a git repository with several branches. I suspect some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.