I can’t Update spring project on Heroku with git

Asked

Viewed 2,657 times

0

I follow the following steps but it doesn’t work:

git init
git add .
git commit -m "mensagem"
git push heroku master 

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git init Reinitialized existing Git Repository in C:/Users/Adriano/Documents/deoliveira-embal/deoliveira-embal/. git/

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git add .

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git commit -m "patch project properties" On branch master Your branch is up-to-date with 'origin/master'. Nothing to commit, Working directory clean

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git push Heroku master fatal: 'Heroku' does not appear to be a git Repository Fatal: Could not read from remote Repository. Please make sure you have the correct access Rights and the Repository exists.

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git status On branch master Your branch is up-to-date with 'origin/master'. Nothing to commit, Working directory clean

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git remote origin

  • You get some error message?

  • 1

    Please add the received output after the last command.

  • Put the output on the command, git status and git remote. I believe you are in the master branch, and have not set up a remote repository.

  • 1

    did git status command and git remote this in the log

  • You did not log in to Heroku before using the command create app Heroku? Or you didn’t use the command in the same git repository folder? I’m almost done with the answer. If I can answer that, I’ll help you figure it out, and I’ll publish.

  • Hello. Was my answer enough to solve your problem? Or are you still in need of something? If it has been. Can you accept it?

Show 1 more comment

1 answer

1

TL;DR

  • Or vc adds remote repository url manually with the command

git remote add [nomecurto] [url]

in this way, git remote addheroku [url-do-app]

OBS: The remote url can be found in Heroku Git URLaqui


  • Or you redo the previous steps of creating the working directory, files, login to Heroku, but using the command heroku create nome-do-app AFTER have logged in and initialized the git repository, thus


    git init
    git add .
    git commit -m "Commit Inicial"
    heroku create ptso-hello-world //OBS O COMANDO PRECISA SER NO MESMO DIRETÓRIO DO REPOSITÓRIO GIT
    git push heroku master


A short explanation of the commands

git init

Serves to initialize a git repository you want to do version control.

The way out

C: Users Adriano Documents deoliveira-embal deoliveira-embal>git init Reinitialized existing Git Repository in C:/Users/Adriano/Documents/deoliveira-embal/deoliveira-embal/. git/

Demonstrates that the repository already existed and has been rebooted, here is ok.

In

C:\Users\Adriano\Documents\deoliveira-embal\deoliveira-embal>git add .

You add the files from the newly initialized repository to version control. Here is ok.

Here

git commit -m "correção prorpriedades projeto"

You create a new "snapshot" of the modified files so that version control can be done, so that it is possible to go back to this point, see later, previous modifications, etc.

The message of return

On branch master Your branch is up-to-date with 'origin/master'. Nothing to commit, Working directory clean

It means you’ve already committed all the changes to the files and there are no new changes. One thing to note (which is in bold) is the branch and the remote repository you refer to, the repository origin.

The output of the command

git push heroku master

gives a hint of the problem,

fatal: 'Heroku' does not appear to be a git Repository fatal: Could not read from remote Repository. Please make sure you have the correct access Rights and the Repository exists.

means that the remote repository named "Heroku" does not exist. As can be seen in the book Pro Git To work with remote repositories we need to add the remote url and give a name to work locally. When we clone, from github for example, the name origin is given automatically.

When we work with Heroku, it also gives a local name to the remote repository automatically named Heroku, but for this we need to have used the command heroku create in the directory that contains our git repository.

By doing this, the "Heroku" adds the url of remote Heroku repository under the name Heroku to work locally, automatically.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.