Git push vs. git push heroku master Git push vs. git push heroku master git git

Git push vs. git push heroku master


To get the behavior you want, you'll need to remove the existing remotes and re-add them:

git remote show origin # copy down the heroku URLgit remote rm origingit remote add origin [github URL]git remote add heroku [heroku URL]


Just using the command git push--that is, omitting the arguments--means that git is going to have to use the defaults, which would be your first remote repository (commonly named 'origin') as the destination, and your local master branch as the source. In your case, I'm guessing that you cloned the project from GitHub in the first place, which makes your default remote be GitHub.

When you specify the arguments git push heroku master, you are explicitly saying to push your local master branch to the remote named heroku -- thus, GitHub is not updated with this command.

(Perhaps heroku was your first/default remote on the PC, and when you moved to the Mac the origin remote was the clone from GitHub?)


The git push command by default pushes to a remote called origin. This usually points to the place where you cloned your repository from, but you can change it later.

The git remote show command will show a list of all remotes. Then, git remote show origin and git remote show heroku will detail how each is configured.

You can manage and change the URL for each remote using the git remote command.