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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:41:53+00:00 2026-06-08T01:41:53+00:00

Say I have two branches master — A – – – – – –

  • 0

Say I have two branches

master -- A -   -   -   -   -  - merge
          \                    /
           \- develop -- B -- C

Now if I want to merge it will be a fast forward, but should I do

git checkout develop
git merge master

or

git checkout master
git merge develop

And what if I have possible conflicts

master -- A - D -  -  -  -  -  -merge
          \                   /
           \- develop -- B -- C

Should I now merge in to develop or into master? This is a bit confusing, so a good explanation would be really appreciated

  • 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-06-08T01:41:55+00:00Added an answer on June 8, 2026 at 1:41 am

    Missing Workflow Tasks

    First of all, there are a few things missing in your workflow that make it hard to answer your question in a real-world way. For example:

    1. You should always pull from upstream before merging branches. Others may have changed develop or master in ways that you haven’t accounted for.

    2. You haven’t identified which is your long-lived line of development. One assumes develop, but that’s just a guess because you haven’t identified what happens to your branches after the merge.

    General Best Practices for Rebasing Long-Lived Branches

    So, assuming that you’ve updated your branches ahead of time, and that master and develop are both long-lived branches and that master is the “official” branch for completed code, then you should do something along these lines.

    1. Make a temporary rebasing branch based on develop.

      git checkout -b tmp develop
      
    2. Rebase your work onto master to ensure a clean fast-forward merge. I like to make this an interactive rebase, but do it any way you want. For example:

      git rebase -i master
      
    3. Merge onto master. I prefer to force the merge to be a fast-forward, but you can do whatever suits you.

      git checkout master
      git merge --ff-only tmp
      
    4. Make sure the merged branch pushes cleanly.

      git push origin
      
    5. If all went well, dispose of your temporary branch.

      git branch -d tmp
      
    6. Re-merge master with develop as a merge commit, rather than a fast-forward. This brings your development into line with the master branch for continued work.

      git checkout develop
      git merge master
      git push origin
      

    Natural Consequences

    Doing this ensures that the history on your master branch is relatively linear and free from merge conflicts, and still allows you to rebase when needed without screwing up published branches. This is all positive stuff.

    However, this process can leave develop with a complex merge history since the re-merging from master to develop may not always be a fast-forward merge. This isn’t a problem, per se, it’s just a natural consequence of any workflow that includes rebasing. It’s something to be aware of, but in my opinion it’s a price worth paying for the flexibility it offers the team.

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

Sidebar

Related Questions

lets say i have two branches master develop in master i have something like
Say I have two large (text) files which are allegedly identical, but I want
Say I have a project with two branches master and dev. I have a
Say you have two main-line branches that have been developed separately for a long
Lets say I have the following two branches and the local branch is 'mybranch'
Let's say I have two branches named default and newfeature . I have a
Let´s say I have two branches, default and mybranch, I would like to write
Let's say you have two public feature branches, feature1 and feature2 . The workflow
On Mac OS X, I have two branches - say A and B -
Lets say I have two branches in RepoX called BranchA and BranchB. RepoX also

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.