19

Recently I saw this field in my heroku application settings.

Link your app to a GitHub repository to see commit diffs in the activity log.

I tried to add 'myusername/myrepo' in this field, but it didn't change anything in activity log. How can I use this setting? And for what?

Airat Shigapov
  • 575
  • 4
  • 19

2 Answers2

19

It's subtle, but your activity log has changed. When you add a repository in Heroku settings, the commit hashes in your activity log turn into links to GitHub, like so:

enter image description here

andypaxo
  • 6,171
  • 3
  • 38
  • 53
  • I am having a problem finding this in heroku's new UI, anyone find it? – barnett Sep 04 '14 at 18:20
  • Things are moved around a little, but the commit hash is still right there in the message. For that repository the message reads "Deployed c656f71", and the commit hash is clickable. – andypaxo Sep 04 '14 at 18:40
10

If you want to see your code in Github you must add Github as a remote repository

git remote add origin https://git.heroku.com/repo.git
git remote set-url --add origin https://github.com/username/repo.git

Every time you push your commits they will push to both heroku and github

git push origin

Now when you click on the commit links, they will take you to github.

seantomburke
  • 10,514
  • 3
  • 18
  • 23
  • Strangely it doesn't work, unless I do it in the UI and save the changes, so from the cli ( Gitbash ) it doesn't work – Roland Jun 06 '13 at 14:58
  • Hmm, I rarely use the Github UI, I always push from the command line and it seems to work for me. What error does it give you? – seantomburke Feb 19 '14 at 00:51
  • I got it working on my Windows machine, but on my OSX one it keeps saying that I have invalid credentials. But if I try with a ssh link, it works. – Roland Feb 19 '14 at 09:29
  • Additionlly to this, add both remotes to a single name like "all" in your .git/config file so you dont have to push twice each time. see answer here: http://stackoverflow.com/questions/4255865/git-push-to-multiple-repositories-simultaneously – mjw May 23 '14 at 05:18