class Heroku::Command::Git
manage git for apps
Public Instance Methods
clone()
click to toggle source
git:clone APP [DIRECTORY] clones a heroku app to your local machine at DIRECTORY (defaults to app name) -r, --remote REMOTE # the git remote to create, default "heroku"
Examples:
$ pogo git:clone example Cloning from app 'example'... Cloning into 'example'... remote: Counting objects: 42, done. ...
# File lib/heroku/command/git.rb, line 21 def clone remote = options[:remote] || "heroku" name = options[:app] || shift_argument || error("Usage: pogo git:clone APP [DIRECTORY]") directory = shift_argument validate_arguments! git_url = api.get_app(name).body["git_url"] puts "Cloning from app '#{name}'..." system "git clone -o #{remote} #{git_url} #{directory}".strip end
remote()
click to toggle source
git:remote [OPTIONS] adds a git remote to an app repo if OPTIONS are specified they will be passed to git remote add -r, --remote REMOTE # the git remote to create, default "heroku"
Examples:
$ pogo git:remote -a example Git remote heroku added $ pogo git:remote -a example ! Git remote heroku already exists
# File lib/heroku/command/git.rb, line 52 def remote git_options = args.join(" ") remote = options[:remote] || 'heroku' if git('remote').split("\n").include?(remote) error("Git remote #{remote} already exists") else app_data = api.get_app(app).body create_git_remote(remote, app_data['git_url']) end end