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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:50:04+00:00 2026-06-11T13:50:04+00:00

I have a git workflow that involves at least two branches, master and staging.

  • 0

I have a git workflow that involves at least two branches, “master” and “staging”. When I’m content with what I’ve put into master, I want to push it to a staging server for others to review, and for that to happen, I need to bring the “staging” branch up to date with the “master” branch.

Currently, I have to do this:

git checkout staging
git merge master
git checkout master

Is there any way for me to merge my current branch into the staging branch in one command?

  • 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-11T13:50:05+00:00Added an answer on June 11, 2026 at 1:50 pm

    In case the merge fails you probably want to handle the conflicts. And as such you need to be checked out at the staging branch, otherwise where will the conflicting files be?

    What you could do is create a shell alias for the process:

    alias updateStage="git checkout staging && git merge master && git checkout master"
    

    In case the merge fails git-merge will return 1 and it won’t attempt to checkout master back, leaving you free to resolve the conflicts.

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

Sidebar

Related Questions

We have currently just master branch. Our current workflow involves implementing the features locally,
I'm getting lost with Git branching model and the workflow that I want to
I have a git repo with two divergent branches, production and v2. I'm working
i want to have the following git workflow, github / \ laptop-----desktop The idea
In my day-to-day git workflow, I have many topic branches, like so: o--o--o (t2)
Is it possible to have git pull and git push in one git command?
We have a git based project with a friend and one master branch. He
I have a git repository that I'm trying to delete all files and folders
I am trying to figure out a git workflow. At the moment we have
Given that we are using GIT with more or less the branching workflow 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.