How do I add a remote Git repository to an Ubuntu Server?

后端 未结 7 649
孤街浪徒
孤街浪徒 2021-01-30 03:52

I have created a Git repository on my Desktop machine (Windows 7) with:

git init
git add 
git commit -m \"added my files\"

7条回答
  •  走了就别回头了
    2021-01-30 04:44

    git remote add origin jonas@192.168.1.10/home/jonas/code/myproject.git
    

    When using SSH, remote repository addresses can be expressed in two ways. One using absolute paths and one using relative paths from the users home directory. You've mixed them up.

    The corrected command would be one of the following.

    git remote add origin jonas@192.168.1.10:code/myproject.git
    git remote add origin ssh://jonas@192.168.1.10/home/jonas/code/myproject.git
    

提交回复
热议问题