-1

When I run git push heroku master, I get this error:

! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/exampleapp-54011.git'

All the files I want to push are in the public folder, this is my app.js:

const express = require("express");
const path = require("path");
const PORT = process.env.PORT || 3000;
const app = express();
app.use(express.static(path.join(__dirname, "public")));
app.listen( PORT, ()=> console.log(`server started at port ${PORT}`) );

Elias Holzmann
  • 3,216
  • 2
  • 17
  • 33
  • https://stackoverflow.com/questions/7986139/git-error-when-trying-to-push-pre-receive-hook-declined – matt Sep 01 '21 at 04:51

1 Answers1

0

You would need to first do a git pull then git push again.

https://stackoverflow.com/a/9794467/16471757

Innextinit
  • 117
  • 11