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

  • SEARCH
  • Home
  • 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 7167039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:30:46+00:00 2026-05-28T14:30:46+00:00

I’ve got a question regarding git branching protocol. I’m starting to get more familiar

  • 0

I’ve got a question regarding git branching protocol. I’m starting to get more familiar with the git commands, but am still fairly new to the process.

I’m working on a git-based project with one other person. We’re adding a large feature, so we isolated our working into ‘Branch_1’. The other developer started working on a bunch of additions in a fork of Branch_1 called Branch_2. The other dev did some work on Branch_2 and then went on to other tasks temporarily. I needed to continue and extend the changes that he made in Branch_2, so I created Branch_3 based on Branch_2.

Figure 1

Branch_1
  |_______> Branch_2  (other developer working on)
                |________> Branch_3  (I'm working on)

While I’m working on Branch_3, I realize a bug FIX that needs to be part of all the branches, and I need the FIX in order to continue with developing Branch_3. (Also, if Branch_3 work is abandoned, the FIX need to be in all the other branches regardless).

So my thought is to checkout Branch_1, make the changes for the FIX, checkout Branch_2, merge in Branch_1, then checkout Branch_3 and merge in the changes from Branch_2. See figure 2 below.

Figure 2

git checkout Branch_1
# make my changes
git pull origin Branch_1  # to pull in any other changes
git push origin Branch_1 

git checkout Branch_2
git pull origin Branch_2    # to pull in any other changes
git merge --no-ff Branch_1  # merge in branch 1 
git push origin Branch_2    # push to the remote repository  

git checkout Branch_3
git pull origin Branch_3    # to pull in any other changes
git merge --no-ff Branch_2  # merge in branch 2
git push origin Brach_3     # push to the remote repository 

However, I wonder about several things in this case:

  1. There are a lot of steps to do. Gets time consuming after awhile. If I create a Branch_4 based off of Branch_3 and a Branch_5 off of Branch_4, yet more steps are involved.
  2. In order to proceed with Branch_3 work after making the FIX, I basically have to make commits to my co-worker’s Branch_2 which he might not realize.
  3. For more complicated setups, I might not relize what branched from what. I could make my bug FIX to Branch_1 and merge it into my co-workers Branch_2, but perhaps my co-worker had created Branch_2 by branching off of some intermediary branch such as Branch_1a. The FIX would not have been properly merged into Branch_1a in the right order.

I’m mainly wondeirng how others would approach a similar situation. Is this the right mindset when making a change that needs to be in a hierarchy of branches?

  • 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-28T14:30:46+00:00Added an answer on May 28, 2026 at 2:30 pm

    Unfortunately, yes. If you want to integrate a fix into all branches you have to either make it once and merge it everywhere or make the fix multiple times (supported by cherry-pick). When worrying about branch2 and that you’re making commits that your coworker is unaware of, just omit branch2. When your coworker eventually merges it back into branch1 (which should be the desired outcome because the secret to successful working with branches is actually merging back again) the fix will automatically incorporated. If he desperately needs the fix you could simply notify him and he can merge it himself.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
i got an object with contents of html markup in it, for example: string
I want to construct a data frame in an Rcpp function, but when I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.