How to synchronize the modifications we make in the repo of our machine with the repo github?

1

I'm following the openlassrooms tutorial on GitHub and I am not able to synchronize the modifications made on the machine with the repo on GitHub:

:~/Swiper_ProjetAutomatisation$ git commit -a -m "Initialise source code"
[master (root-commit) d41462a] Initialise source code
 1 file changed, 132 insertions(+)
 create mode 100755 testPostreSQLPythonG.py
:~/Swiper_ProjetAutomatisation$ git push origin master
fatal: 'origin' 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.

I've read on StackOverflow a response from Matt Clark that seems a little too general to help me. Matt Clark proposes, when git remote -v does not return anything, do:

$git remote add origin ssh://[email protected]:1234/myRepo.git

If, in my case, git remote -v does not return anything, on the one hand I do not know what to replace in [email protected]:1234/myRepo.git and on the other hand the teacher on the tutorial tells us not to use ssh at the moment but https.

    
asked by ThePassenger 30.05.2017 в 12:13
source

1 answer

0

ssh://[email protected]:1234/myRepo.git is a URI, which means:

  • ssh:// - > ssh protocol.
  • git@ - > ssh connection user.
  • example.com - > server.
  • :1234 - > ssh port.
  • /myRepo.git - > folder inside the server.

From ssh:// , the rest of the String varies depending on the protocol.

Since you use https:// , you will use the URIs in HTTP / HTTPS format. For example, for a server on github.com:

https://github.com/MiUsuario/MiRepositorio

It should also support that you add username and password (the latter is not recommended that you put it in remote ):

https://[email protected]/MiUsuario/MiRepositorio
https://miUsuario:miContraseñ[email protected]/MiUsuario/MiRepositorio
    
answered by 30.05.2017 / 12:24
source