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

后端 未结 7 740
孤街浪徒
孤街浪徒 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

    Connecting your Local Repo. to Git Remote Server Ubuntu

    Create a User in remote server and assign permission for ssh access using ssh-keygen in your local server and paste, its .pub file to ssh of the remote server.

    Things to do on remote Server

    Server : XX.XXX.1XX.XX

    Inside Putty command line

    1. Go to location : cd ~/srv/git srv in your root directory

    2. Make a folder : mkdir your_file_name followed by cd inside your file inside your git folder

    3. initialize git there : git init --bare

         Done
      

    Things to do On Local Machine

    1. create your repository ..

    2. initializing Git: git init

    3. Create the remote connection : git remote add origin git@xx.xxx.xxx.xxx:/srv/git/your_file_name

    4. git push.

          Done
      

    If you got stuck any point refer :https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server.

提交回复
热议问题