This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Forces all Git connections to use SSH instead of HTTPS when accessing GitHub.com | |
git config --global --add url."[email protected]:".insteadOf "https://github.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Purge the Heroku Build Cache using the terminal. This requires a new deployment FYI. | |
# Replace appname with name of application on Heroku. | |
heroku plugins:install heroku-repo | |
heroku repo:purge_cache -a appname | |
git commit --allow-empty -m "Purge cache" | |
git push heroku master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To copy database from one heroku app to another - | |
``` | |
heroku pg:backups capture [database_name] | |
heroku pg:backups restore $(heroku pg:backups public-url --app source_app) DATABASE_URL --app target_app | |
``` | |
You can refer to https://devcenter.heroku.com/articles/heroku-postgres-backups for more information. | |
To copy database from local to heroku - | |
Dump your local database in compressed format using the open source pg_dump tool: `PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump` | |
where `myuser` is your database username and `mydb` is the database name. |