git push -f origin master
Github
Pushing a non-master branch to Heroku
I completed a React project with a Rails API backend. Locally everything worked prefectly. When trying to change environment variables like the address of the API backend, I wanted to create a seperate branch for heroku, it case I needed to edit something for heroku. I would rather not clutter “master” with changes until they are 100% working.
Problem is heroku only recognizes master branches, but to test I need to commit to master
Well there is a work aorund, just push a different branch up to heroku manually
git push heroku [name-of-your-branch]:master
this way I can push up a branch I named heroku up to heroku.
Credit: link from Jordon Trevino
Github markdown create links to sections in same md file
tldr: [Link text or description](#this-is-my-header-name-I-want-to-link-to)
I had a long Readme file, and wanted easy access on top to the sections of the Readme.md file.
If you have a header, you can link to that header
create a header: ##This is my header
the link to the header would be: [Link text or description](#this-is-my-header)
As you can see its just converting your text to lowercase and using dash instead of spaces.
If you are having a problem, you can always highlight the header and the link will show at the bottom of chrome. See how that python looking object showed up next to “Examples”, and at the bottom is the full hyerlink. In this example, just the #example would suffice as I did in my example above
Cannot push commit to github :
Error:
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
hint: Updates were rejected because the remote contains work that you do
FIX