0

I have an app built in Django and hosted on Heroku. My app uses Heroku Pipelines, and yesterday I promoted my code to production after testing it in staging. A bug popped up this morning, so I decided to check the code in my local heroku branch. (BTW, I have a passable understanding of Git. Usually I can get it to work without major problems, but there is much I don't understand.) When I checked out the branch, I saw this message:

Your branch is behind 'origin/heroku' by 4 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)

I should mention that this is the first time I have checked out this branch. When I tried to perform a git pull, I got another message:

Your configuration specifies to merge with the ref 'refs/heads/heroku'
from the remote, but no such ref was fetched.

After a ton of googling, I discovered that this has happened to others. The fixes I found (here, here, here, and here), however, don’t seem to apply to my situation. These answers (here, here, and here) get closer, I think, but I don’t quite understand how to apply either solution to my error.

Here’s my .git/config:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = https://some/project/on/github.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "heroku"]
    remote = origin
    merge = refs/heads/heroku
[remote "heroku"]
    url = https://git.heroku.com/project-name.git
    fetch = +refs/heads/*:refs/remotes/heroku/*
[branch "stripe"]
    remote = origin
    merge = refs/heads/stripe

Questions 1) With Heroku Pipelines, how can the commits from staging be different from those in production? Maybe they aren't? 2) How do commits get ahead of master in the first place? This has happened in my other branches on occasion, but I'm never clear why or how they happen. 3) What is supposed to be merged with the ref? I’m not entirely clear on what the expectation is there. Is it expecting HEAD? 4) Why wasn’t the ref fetched and from where should it have been fetched?

Thanks for any ideas on how to proceed!

Community
  • 1
  • 1
  • There are several ways your local repository could be behind the heroku remote repo, including pushing from another branch. It sounds like your git questions aren't directly related to your heroku pipeline question, and may be better separate. – BM5k May 11 '16 at 07:57

1 Answers1

0

Promoting an app from one stage to another replaces the slug without updating the git remote.

I think this was originally a little more clear in the docs, but https://devcenter.heroku.com/articles/pipelines#promoting just says

When a change has been tested sufficiently in a particular stage, the slug can be promoted to the downstream stage using the Promote button.

BM5k
  • 1,210
  • 10
  • 28
  • We had someone else working on a branch, and I believe this is what happened. The promotion was rolled back, but the git remote wasn't updated. I cleaned everything up by utilizing git fetch, checkout, and re-pushing everything to origin/heroku. It was a bit of mess, though, and they definitely need to update the rollback documentation! – knittingarch May 11 '16 at 13:56
  • If I remember correctly, rollback also just replaces the slug without affecting git. – BM5k May 11 '16 at 15:01