TL; DR
git remote add [nomecurto] [url]
This way, git remote add
heroku [url-do-app]
OBS : The remote url can be found at Heroku Git URL
Oryouredothepreviousstepsofcreatingtheworkingdirectory,thefiles,logginginheroku,butusingthecommandherokucreatenome-do-app
AFTERhaveloggedinandinitializedthegitrepository,so
gitinit
gitadd.
gitcommit-m"Commit Inicial"
A brief explanation of commands
heroku create ptso-hello-world //OBS O COMANDO PRECISA SER NO MESMO DIRETÓRIO DO REPOSITÓRIO GIT
Use to initialize a git repository that you want to do version control.
The output
C: \ Users \ Adriano \ Documents \ drain-wrap \ drain-wrap> git init
Reinitialized existing Git repository in
C: /Users/Adriano/Documents/deoliveira-embal/deoliveira-embal/.git /
Show that the repository already existed and was rebooted, here it is ok.
In
git push heroku master
You add the files from the newly initialized repository to version control. Here it is ok.
Here
git init
You create a new snapshot of the modified files so that version control is done, so that you can go back to this point, see subsequent changes, previous modifications, etc.
The return message
On branch master Your branch is up-to-date with 'origin / master' .
nothing to commit, working directory clean
It means that you have committed all 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 it refers to, the origin repository.
The command output
C:\Users\Adriano\Documents\deoliveira-embal\deoliveira-embal>git add .
give 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 repositories remote 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 go to work with heroku, it also gives a local name to the remote repository automatically with the name of heroku , but for this we need to use the command git commit -m "correção prorpriedades projeto"
in the directory that contains our git repository .
By doing this, heroku adds the heroku remote repository url under the name heroku to work locally, automatically.