日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

使用git建立远程仓库,让别人git clone下来

發布時間:2024/9/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用git建立远程仓库,让别人git clone下来 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先, 如果你的ssh沒有安裝的話,要安裝ssh服務端。ubuntu是很簡單

  • sudo apt-get install openssh-server
  • 1 建立你的 git? 目錄。


    ourunix@ubuntu:~$ mkdir testgit

    ourunix@ubuntu:~$ cd testgit/

    2,建立你的git倉庫。

    ourunix@ubuntu:~/testgit$ git init

    Initialized empty Git repository in /home/wlp/testgit/.git/

    3,添加你的需要的項目初始文件,這里我就只添加一張文檔了。

    ourunix@ubuntu:~/testgit$ echo "hello,git" > sayhi.txt

    4,跟蹤及提交到倉庫。

    ourunix@ubuntu:~/testgit$ git add sayhi.txt

    ourunix@ubuntu:~/testgit$ git commit -m "2011.4.13" sayhi.txt

    [master (root-commit) b87b535] 2011.4.13

    1 files changed, 1 insertions(+), 0 deletions(-)

    create mode 100644 sayhi.txt

    5.在本地的git倉庫"添加一個遠程倉庫",當然這個遠程倉庫還是你自己的這個目錄。

    ourunix@ubuntu:~/testgit$ git remote add origin ssh://你的用戶名@你的IP/~/testgit/.git

    這時候,本地的?.git/config?應該會改變

    6.將本地的?master分支?,跟蹤到遠程的分支

    ourunix@ubuntu:~/testgit$ git push origin master

    7,顯示遠程信息

    ourunix@ubuntu:~/testgit$git remote show origin

    8,利用其他局域網的電腦測試你的倉庫

    ourunix@ubuntu:~/test$ git clone ssh://你的用戶名@你的IP/home//testgit/.git

    Initialized empty Git repository in /home/wlp/test/git/.git/

    xxx‘s password:

    remote: Counting objects: 3, done.

    Receiving objects: 100% (3/3), done.

    remote: Total 3 (delta 0), reused 0 (delta 0)

    ? ? ?

    9,大功告成

    10.??修改遠程分支地址

    ???? git remote set-url origin remote_git_address



    來源:http://www.360doc.com/content/16/1207/10/28838452_612646555.shtml

    總結

    以上是生活随笔為你收集整理的使用git建立远程仓库,让别人git clone下来的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。