git remote heroku masterがうまくいかなかった原因


ec2-user:~/environment/hello_app (master) $ git remote -v
heroku  https://git.heroku.com/immense-shelf-83217.git (fetch)
heroku  https://git.heroku.com/immense-shelf-83217.git (push)
ec2-user:~/environment/hello_app (master) $ heroku app
 ›   Warning: app is not a heroku command.
Did you mean apps? [y/n]: 
 ›   Error: Run heroku help for a list of available commands.
ec2-user:~/environment/hello_app (master) $ heroku_app
bash: heroku_app: command not found
ec2-user:~/environment/hello_app (master) $ heroku apps
=== アドレス Apps
frozen-river-01428
guarded-journey-61586
immense-shelf-83217
mighty-cliffs-86208
mysterious-lowlands-71763

ec2-user:~/environment/hello_app (master) $ heroku destroy --app frozen-river-01428
 ▸    WARNING: This will delete ⬢ frozen-river-01428 including all add-ons.
 ▸    To proceed, type frozen-river-01428 or re-run this command with
 ▸    --confirm frozen-river-01428

> frozen-river-01428
Destroying ⬢ frozen-river-01428 (including all add-ons)... done
ec2-user:~/environment/hello_app (master) $ $ heroku destroy --app guarded-journey-61586
bash: $: command not found
ec2-user:~/environment/hello_app (master) $ heroku destroy --app guarded-journey-61586
 ▸    WARNING: This will delete ⬢ guarded-journey-61586 including all add-ons.
 ▸    To proceed, type guarded-journey-61586 or re-run this command with
 ▸    --confirm guarded-journey-61586

> heroku destroy --app guarded-journey-61586
 ▸    Confirmation did not match guarded-journey-61586. Aborted.
ec2-user:~/environment/hello_app (master) $ heroku destroy --app mighty-cliffs-86208
 ▸    WARNING: This will delete ⬢ mighty-cliffs-86208 including all add-ons.
 ▸    To proceed, type mighty-cliffs-86208 or re-run this command with
 ▸    --confirm mighty-cliffs-86208

> mighty-cliffs-86208
Destroying ⬢ mighty-cliffs-86208 (including all add-ons)... done
ec2-user:~/environment/hello_app (master) $ heroku destroy --app mysterious-lowlands-71763
 ▸    WARNING: This will delete ⬢ mysterious-lowlands-71763 including all add-ons.
 ▸    To proceed, type mysterious-lowlands-71763 or re-run this command with
 ▸    --confirm mysterious-lowlands-71763

> mysterious-lowlands-71763
Destroying ⬢ mysterious-lowlands-71763 (including all add-ons)... done
ec2-user:~/environment/hello_app (master) $ heroku apps
=== アドレス Apps
guarded-journey-61586
immense-shelf-83217

ec2-user:~/environment/hello_app (master) $ heroku open
 ▸    Error opening web browser.
 ▸    Error: Exited with code 3
 ▸    
 ▸    Manually visit https://immense-shelf-83217.herokuapp.com/ in your browser.
ec2-user:~/environment/hello_app (master) $ heroku destroy --app immense-shelf-83217
 ▸    WARNING: This will delete ⬢ immense-shelf-83217 including all add-ons.
 ▸    To proceed, type immense-shelf-83217 or re-run this command with
 ▸    --confirm immense-shelf-83217

> immense-shelf-83217
Destroying ⬢ immense-shelf-83217 (including all add-ons)... done
ec2-user:~/environment/hello_app (master) $ heroku apps
=== アドレス Apps
guarded-journey-61586

ec2-user:~/environment/hello_app (master) $ heroku open
 ›   Error: Missing required flag:
 ›     -a, --app APP  app to run command against
 ›   See more help with --help
ec2-user:~/environment/hello_app (master) $ heroku destroy --app guarded-journey-61586
 ▸    WARNING: This will delete ⬢ guarded-journey-61586 including all add-ons.
 ▸    To proceed, type guarded-journey-61586 or re-run this command with
 ▸    --confirm guarded-journey-61586

> guarded-journey-61586
Destroying ⬢ guarded-journey-61586 (including all add-ons)... done
ec2-user:~/environment/hello_app (master) $ heroku apps
You have no apps.
ec2-user:~/environment/hello_app (master) $ bundle install --without production
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Using rake 13.0.1
Using concurrent-ruby 1.1.5
Using i18n 1.7.0
Using minitest 5.13.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Using activesupport 5.1.7
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.7
Using rails-dom-testing 2.0.3
Using crass 1.0.5
Using loofah 2.4.0
Using rails-html-sanitizer 1.3.0
Using actionview 5.1.7
Using rack 2.0.8
Using rack-test 1.1.0
Using actionpack 5.1.7
Using nio4r 2.5.2
Using websocket-extensions 0.1.4
Using websocket-driver 0.6.5
Using actioncable 5.1.7
Using globalid 0.4.2
Using activejob 5.1.7
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailer 5.1.7
Using activemodel 5.1.7
Using arel 8.0.0
Using activerecord 5.1.7
Using public_suffix 4.0.2
Using addressable 2.7.0
Using bindex 0.8.1
Using bundler 1.17.3
Using byebug 9.0.6
Using xpath 3.2.0
Using capybara 2.18.0
Using childprocess 3.0.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 1.0.1
Using railties 5.1.7
Using coffee-rails 4.2.2
Using ffi 1.11.3
Using multi_json 1.14.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.1
Using ruby_dep 1.5.0
Using listen 3.1.5
Using puma 3.9.1
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.1.7
Using rubyzip 2.0.0
Using sass-listen 4.0.0
Using sass 3.7.4
Using tilt 2.0.10
Using sass-rails 5.0.6
Using selenium-webdriver 3.142.7
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Using sqlite3 1.3.13
Using turbolinks-source 5.2.0
Using turbolinks 5.0.1
Using uglifier 3.2.0
Using web-console 3.7.0
Bundle complete! 18 Gemfile dependencies, 71 gems now installed.
Gems in the group production were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
ec2-user:~/environment/hello_app (master) $ git commit -a -m "Update Gemfile for Heroku"
On branch master
Untracked files:
        heroku/

nothing added to commit but untracked files present
ec2-user:~/environment/hello_app (master) $ heroku --version
heroku/7.35.1 linux-x64 node-v12.13.0
ec2-user:~/environment/hello_app (master) $ heroku login --interactive
heroku: Enter your login credentials
Email [アドレス]: 
Password: ************
Logged in as car_fact_rock@yahoo.co.jp
ec2-user:~/environment/hello_app (master) $ heroku create
Creating app... done, ⬢ guarded-cove-74899
https://guarded-cove-74899.herokuapp.com/ | https://git.heroku.com/guarded-cove-74899.git
ec2-user:~/environment/hello_app (master) $ git push heroku master

$ git remote -v
にて現在fetch、pullしてるappを確認
それに対して、createしたappが$ heroku appsで確認したところ、たくさんあったため、一旦すべて消して、もう一度やったら、うまくいった。

反省
git remote -vを知らなかったこと