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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:04:50+00:00 2026-05-14T07:04:50+00:00

Is it possible to merge changes from a central repo to a local branch

  • 0

Is it possible to merge changes from a central repo to a local branch without having to commit/stash the edits on the local branch and checkout master?

If I am working on local branch “work” and there are some uncommited changes, I use the following steps to get updates from the central repo into my working branch.

git stash
git checkout master
git pull 
git checkout work
git rebase master
git stash pop

Usually there are no uncommitted changes in “work” and then I omit the stash steps.

What I would really like is something like the following:

git pull master  (updates master while work branch is checked out and has changes)
git rebase master (rebases the updates into work branch uncommited changes are still safe)

Is there something easier than what I currently do?

  • 1 1 Answer
  • 1 View
  • 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-14T07:04:50+00:00Added an answer on May 14, 2026 at 7:04 am

    You can do (on branch work):

    git stash
    git pull --rebase origin master
    git stash apply
    

    git pull --rebase both pulls remote changes and rebases your local changes on top of the remote ones. I.e. essentially does what you show in your script.

    Local changes, of course, should be committed or stashed on merge or rebase (because if merge conflict happens, conflicting changes should be uncommitted for you to resolve them–but where would your local changes go then?)

    When you later decide to update master and to merge work branch with it, it won’t cause problems, since changes pulled are the same. So you don’t have to update master when you pull changes.

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

Sidebar

Related Questions

Mercurial - Is it possible to merge changes from the trunk to a branch,
Is it possible to merge a range of revisions from one branch to another
We need to merge changes from branch to trunk. And we do not need
Possibly related to Git - pulling changes from clone back onto the master I
What is the best way to stash working tree, update the local branch and
A new branch from master is created, we call it test . There are
Is it possible to condense the commits on a branch into a single commit
Is it possible to merge Google Fusion Tables using GQL or other Javascript/REST API?
Is it possible to merge two JSON documents with the Jackson JSON library? I
Is that possible to distinguish if merge was performed manually or automatically? I'm using

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.