TL;DR
- Or vc adds remote repository url manually with the command
git remote add [nomecurto] [url]
in this way, git remote add
heroku [url-do-app]
OBS: The remote url can be found in Heroku Git URL
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.
You get some error message?
– Wilker
Please add the received output after the last command.
– Murillo Goulart
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.
– Wilker
did git status command and git remote this in the log
– Adriano
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.
– Wilker
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?
– Wilker