Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deploying from a detached head #12

Merged
merged 1 commit into from
Jul 18, 2013
Merged

Allow deploying from a detached head #12

merged 1 commit into from
Jul 18, 2013

Conversation

melcher
Copy link
Contributor

@melcher melcher commented Jul 16, 2013

I'm having an issue deploying to brand new heroku servers.
The first push to a new server is failing with:

error: unable to push to unqualified destination: master
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@heroku.com:blue-register-18.git'

This is important to me as I'm having travis-ci create a new heroku server against each pull request.
Seems to be the same issue discussed here: http://git.661346.n2.nabble.com/error-with-git-push-origin-HEAD-newbranch-td6333596.html
As far as I can tell, the "master" branch is not yet a known branch on the new heroku server, and the local HEAD is detached so git doesn't know whether the "master" it's pushing is a branch or tag. This is resolved by specifying that it is, indeed, a branch: refs/heads/master.
This may be git-version dependent, as mentioned in the mailing list. I experience the error through travis-ci but have been unable to reproduce the error locally locally (git version 1.7.5.4).

Thanks!

@melcher
Copy link
Contributor Author

melcher commented Jul 16, 2013

FYI I have not confirmed that this resolves my issue, currently waiting for travis to pass/fail.

@melcher
Copy link
Contributor Author

melcher commented Jul 18, 2013

It passed - this fix resolved my issue.

@melcher
Copy link
Contributor Author

melcher commented Jul 18, 2013

Here's how this is being used:
https://gist.github.com/melcher/6026768

moredip added a commit that referenced this pull request Jul 18, 2013
Allow deploying from a detached head
@moredip moredip merged commit abf44a5 into moredip:master Jul 18, 2013
@moredip
Copy link
Owner

moredip commented Jul 18, 2013

Thanks for the investigation and the fix :)

@melcher
Copy link
Contributor Author

melcher commented Jul 18, 2013

Thanks for pulling it in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants