diff --git a/lib/dpl/provider/heroku/git.rb b/lib/dpl/provider/heroku/git.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/provider/heroku/git.rb
+++ b/lib/dpl/provider/heroku/git.rb
@@ -2,14 +2,23 @@ module DPL
   class Provider
     module Heroku
       class Git < Generic
+        require 'netrc'
+
         def git_url
-          "https://#{option(:api_key)}@git.heroku.com/#{option(:app)}.git"
+          "https://git.heroku.com/#{option(:app)}.git"
         end
 
         def push_app
+          write_netrc
           git_remote = options[:git] || git_url
           context.shell "git push #{git_remote} HEAD:refs/heads/master -f"
         end
+
+        def write_netrc
+          n = Netrc.read
+          n['git.heroku.com'] = [user, option(:api_key)]
+          n.save
+        end
       end
     end
   end
heroku http git: write token to netrc, so it wont get printed to the logs accidentially