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

The Archive Base Latest Questions

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

I currently have a git repository at github that stores the packaging files for

  • 0

I currently have a git repository at github that stores the packaging files for a bunch of packages with a directory structure like this:

package-a
  `- PKGBUILD
package-b
  `- PKGBUILD
package-c
  `- PKGBUILD
xorg
  `- PKGBUILD
libx11
  `- PKGBUILD

I created an experimental branch, newxorg, that contains packaging files for a new version of xorg and libx11 and also updated package-a and package-b on master. My history is something like this:

M1 -- M2 -- M3 -- M4
       \
        B1 -- B2

where:
B1 = "Update xorg"
B2 = "Update libx11"
M3 = "Update package-a"
M4 = "Update package-b"

Ideally, I’d like my new branch to contain the M3 and M4 commits from master, like this:

M1 -- M2 -- M3 -- M4
                   \
                    B1 -- B2

But the problem is that I’ve already pushed both master and the newxorg branch to the remote github server. Since people have already cloned the new branch, I’m guessing a rebase would really screw things up for them. What would be the best way to merge the new commits from master?

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

    If there aren’t too many new commits on master I would cherry-pick them on newxorg.

    Following your example, cherry picking M3 and M4 from master on newxorg would get you from:

    M1 -- M2 -- M3 -- M4
       \
        B1 -- B2
    

    to:

    M1 -- M2 -- M3 -- M4
       \
        B1 -- B2 -- M3 -- M4
    

    You will have M3 and M4 separately on newxorg.

    With cherry-pick you would have a “small” problem if you decide to merge newxorg into master (at a later stage) since cherry-pick would create other commits identical in every point to the original M3 and M4 commits, BUT with a different sha1 hash. You (and others) will see this in the history as duplicate commits…

    There is also the option of merging master into newxorg (but that would create another merge commit so it isn’t exactly what you asked for).

    In your case I would prefer to use the merging method to avoid later problems.

    Choose whatever method you see fit.


    LE. Merging details

    As you requested, here are a bit more details about the merging method:

    1. checkout the newxorg branch (git checkout newxorg)
    2. merge master into newxorg (git merge master)

    If you have problems checking out the newxorg branch you might need to stash the changes you have in your working copy: git stash and when you need those changes back you can do a git stash pop (pop applies the changes and then discards the stash) or a git stash apply (apply applies the changes and keeps the stash).

    Here is the initial setup:

    initial setup

    and the final setup:

    final setup

    At a later stage, when you want to merge back newxorg into master use these commands:

    git checkout master
    git merge newxorg
    

    If you will have conflicts when merging you can use the git mergetool to resolve the conflicts. You might need to configure a visual merge tool such as p4merge (which is cross-platform).

    PS. in case you’re wondering where did I get those screenshots from: they are from your repository on github.

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

Sidebar

Related Questions

folks, I have the directory structure like this: webapps |-- static_media |-- django |---project
I currently have a git repository that I imported from svn a while ago
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
I'm really quite frustrated at this point. I have an existing hg repository that
I have a Git repository that is accessed from both Windows and OS X,
I'd like to replace my svn repository with git. Unfortunately I can't do this
I have an existing Git repository on Github. I wanted to reorganise my code,
I currently have Git setup with a central bare repository which is accessed by
I have a git repository on an OS X server that used to work
Here's the scenario: I have a local git repository that mirrors the contents of

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.