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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:53:16+00:00 2026-05-26T04:53:16+00:00

I know this is a basic question. Finishing a release, I push master branch

  • 0

I know this is a basic question.

Finishing a release, I push master branch to production.

Then, I am working on development branch to add new features.

Now the questions:

Q1: When I push the development branch to staging (on heroku) using git push app-name-staging development:master, I get the following error. Why? How to fix it?

! [rejected] development -> master (non-fast-forward)

error: failed to push some refs to 'git@heroku.com:app-name-staging.git'

Q2: While working on the development branch, someone finds a bug. I switch to the master branch, and fix the bug. What is the proper way to merge the bug fix made in the master branch into the dev branch, without changing the master branch?

Thanks.

  • 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-26T04:53:17+00:00Added an answer on May 26, 2026 at 4:53 am

    In reverse order, because 2 is simpler:

    git checkout dev
    git merge master
    

    That’s it. It doesn’t change master at all. It just merges all changes made on master into your dev branch.

    For the other, the non-fast-forward error is telling you that there are commits in the branch you’re pushing to that would be overwritten if your push were to succeed. Typically, it happens when two people are working in the same branch. Suppose you and I both have commit A, and we both start working on it in the same branch. You create commit B1, and I create B2. Both have A as their parent. Say you push first, so now the remote branch has A—B1. Locally, I have A—B2. If I were to push my branch, then A—B2 is what would be on the remote, so your commit would be lost. This is where I’d get the non-fast-forward error. The correct way to resolve this is to first pull to get the changes that someone else put out there, and then push the result. In the example, If I pulled, I’d end up with:

       C
      /  \
    B1    B2
      \  /
       A
    

    Specifically, git first grabs your B1, which is a child of A and sibling of B2, then it merged B1 and B2 together to form C. Now I can push C back to the remote without losing any history because your B1 is correctly represented there.

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

Sidebar

Related Questions

I know this is a basic RTFM question but I'm pretty new to rails
I know this is a very basic question. I am new to web programming.Im
I know this maybe a basic question but I just can't seem to find
I know this maybe a very basic question but I'm having a bit of
I know this is a pretty basic question, and I think I know the
I know this should be a basic question but I am hitting a brick
Ok, I know this is a very basic question, but my head is swimming
guys I know this question is very basic but I've met in few publications
This is a very very basic question and I know one way is to
I know, this might be a very basic question but I am not 100%

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.