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 864555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:29:51+00:00 2026-05-15T09:29:51+00:00

I have the following problem: We have a large product which is in master

  • 0

I have the following problem:
We have a large product which is in master branch. Also we have other branches that have only few files, the files that are specific to this branch only. Each of those branches represent a plugin to the main product. So for example when you get the main product, you receive lots of files, install them, etc. and later when you decide to get a plugin, you receive a package containing several files only and by uploading these file (and replacing the original ones) you get the plugin installed.

Let’s I have payment.php in master branch (as well as many other files). And I have paypal branch which has one file only which is payment.php. Now I fix a bug in master’s payment.php and want to merge this fix in paypal branch. However when I run merge, absolutely all files get added to that branch. So in the end paypal branch has all the files from master branch. Do you by chance know how this can be fixed? I want GIT to merge the files that exist in this branch only, so in the example above the paypal branch should still have one file only (payment.php) with the bug fix merged in.

  • 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-15T09:29:52+00:00Added an answer on May 15, 2026 at 9:29 am

    This is why it’s important to manage your branches well, in particular to use topic branches and to merge upwards.

    You should make that fix on a topic branch, forked from a common ancestor of all branches which will need the fix, and then merge it into both master and paypal:

    x - x - x - x ------------- X (master)
    |\                          |
    | x - x - x ---- X (paypal) |
     \              /           /
      x (bugfix) ---------------
    

    If you have already made your bugfix, and you mistakenly made it on master instead of from the appropriate merge base, and the history on master hasn’t been published, you should cherry-pick or rebase it to the right place:

    # If the bugfix commit is not at the tip of master, you can rebase to get it there:
    git rebase -i <commit before the bugfix> master
    # rearrange the list of commits to put the bugfix at the tip, save and quit
    
    # Now either cherry-pick or rebase the commit to the right place
    # (rebase is easier if the bugfix is actually several commits)
    
    # Cherry-pick
    # make a branch and cherry-pick
    git checkout -b bugfix <SHA1 of merge base>
    git cherry-pick <SHA1 of bugfix>
    # remove the commit from master, assuming it's still on the tip
    git checkout master
    git reset --hard master^
    
    # or rebase
    # make the bugfix branch (assuming it's still on the tip)
    git branch bugfix master
    # and remove the commit from master (assuming it's still on the tip)
    git checkout master
    git reset --hard master^    # or if the bugfix is composed of n commits, master~n
    # rebase the bugfix branch to the right place
    git rebase --onto <SHA1 of merge base> master bugfix
    

    If the history has been published, all you can do is cherry-pick the bugfix onto the paypal branch, and remember to do it right the next time:

    git checkout paypal
    git cherry-pick <SHA1 of bugfix>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem that the standard library doesn't solve well, and I'm
I have the following problem. I have a table with a few hundred thousand
I have a following problem. A large rectangle contains smaller non-intersecting rectangles (The black
My application problem is the following - I have a large structure foo. Because
I face the following problem. I have two large tables with about 80.000 records
I have the following code, in which I’m trying to process a large amount
Hey guys, i have the following problem: 1 process executes a very large query
I have the following problem. I have a quartz job that runs every 5
I have a large table which has a background-color on each td. I also
I have following problem: I have built a tabbar application with 4 tabs. I

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.