Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore warning when pushing to heroku git master

Tags:

git

bash

heroku

I'm deploying an app to Heroku, which means pushing to their git repo. When do git push heroku master (or the equivalent remote alias) I get this warning:

WARNING: You're about to push to master, is that what you intended? [y|n]

Which is kinda annoying but not a big deal. However, I'm now scripting deployments so I don't want to have interact with the script - how I do get my bash script to answer y automatically?

I tried doing yes | git push heroku master but that doesn't work.

like image 483
Jaco Pretorius Avatar asked Mar 21 '20 18:03

Jaco Pretorius


1 Answers

Agree with @bk2204, I would check if a git hook is being used that you are unaware of.

Git hooks are not version controlled, so make sure you are searching for this at the machine where you get this error.

The git hook may live elsewhere other than the .git directory. Check if git config core.hooksPath is set and if so, it will point to the directory where your git hook is.

The hook file that you are looking for will most likely have the name pre-push. The solution in this case is to remove or rename this hook file, and git won't run it before push.

like image 107
Petr Gazarov Avatar answered Sep 21 '22 16:09

Petr Gazarov