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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

gitlab git clone 卡住_gitlab从入门到绝望

發布時間:2024/9/27 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gitlab git clone 卡住_gitlab从入门到绝望 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

啥年月了還用svn,日了狗一樣難受。

開搞!

docker是最好的容器,直接docker裝gitlab。

學新玩意不去官網不是人:

https://docs.gitlab.com/omnibus/docker/#expose-gitlab-on-different-ports


  • docker pull gitlab/gitlab-ce

  • sudo docker run --detach \ ?--hostname gitlab.example.com \ ?--publish 443:443 --publish 80:80 --publish 22:22 \ ?--name gitlab \ ?--restart always \ ?--volume /srv/gitlab/config:/etc/gitlab \ ?--volume /srv/gitlab/logs:/var/log/gitlab \ ?--volume /srv/gitlab/data:/var/opt/gitlab \ ?gitlab/gitlab-ce:latest

  • 官網上這樣說,可是他么的他報錯了真的報錯了:

    cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied 。他說:掛載的本地目錄在容器中沒有執行權限

    解決方案:加權限 ?--privileged=true 這個很有用在我的docker文章中也有遇到沒權限的情況,遇到沒權限先加一下試試。

    我試了試,確實成功了。但是我想改端口!那么官老爺又說了:

    For example, to expose the web interface on port?8929, and the SSH service on port?2289, use the following?docker run?command:

    sudo docker run --detach \ ?--hostname gitlab.example.com \ ?--publish 8929:80 --publish 2289:22 \ ?--name gitlab \ ?--restart always \ ?--volume /srv/gitlab/config:/etc/gitlab \ ?--volume /srv/gitlab/logs:/var/log/gitlab \ ?--volume /srv/gitlab/data:/var/opt/gitlab \

    --privileged=true\ ?gitlab/gitlab-ce:latest


    (他又忘了加權限?或者按照官老爺說的這樣可以嗎

    If you are on?SELinux?then run this instead:

    sudo docker run --detach \
    --hostname gitlab.example.com \
    --publish 443:443 --publish 80:80 --publish 22:22 \
    --name gitlab \
    --restart always \
    --volume /srv/gitlab/config:/etc/gitlab:Z \
    --volume /srv/gitlab/logs:/var/log/gitlab:Z \
    --volume /srv/gitlab/data:/var/opt/gitlab:Z \
    gitlab/gitlab-ce:latest

    )

    Note:?The format for publishing ports is?hostPort:containerPort. Read more in Docker’s documentation about?exposing incoming ports.

    (怎樣設置?

    官網上往回看發現:

    Configure GitLab

    This container uses the official Omnibus GitLab package, so all configuration is done in the unique configuration file?/etc/gitlab/gitlab.rb.

    To access GitLab’s configuration file, you can start a shell session in the context of a running container. This will allow you to browse all directories and use your favorite text editor:

    sudo docker exec -it gitlab /bin/bash

    You can also just edit?/etc/gitlab/gitlab.rb:

    sudo docker exec -it gitlab editor /etc/gitlab/gitlab.rb

    Once you open?/etc/gitlab/gitlab.rb?make sure to set the?external_url?to point to a valid URL.

    可以繼續了

    :)

  • Set?external_url:

    # For HTTP
    external_url "http://gitlab.example.com:8929"

    or

    # For HTTPS (notice the https)
    external_url "https://gitlab.example.com:8929"

    For more information see the?NGINX documentation.

  • Set?gitlab_shell_ssh_port:

    gitlab_rails['gitlab_shell_ssh_port'] = 2289
  • Following the above example you will be able to reach GitLab from your web browser under?:8929?and push using SSH under the port?2289.

    (我一直有個疑問,明明端口映射的是2289:22 ?映射的不是22嗎為什么還要這樣子:['gitlab_shell_ssh_port'] = 2289 ?

    )然后重啟:

    sudo docker restart gitlab

    好像這樣也行:gitlab-ctl reconfigure

    Note:?The initialization process may take a long time. You can track this process with the command?sudo docker logs -f gitlab

    人家說初始化需要很長時間你可以看日志或者嗑瓜子

    我是不停地賤賤的docker ps

    看他一直在restaring。。。。。。盼星星盼月亮終于盼到health狀態

    看招:

    首頁點扳手可以創建用戶創建群組創建項目:

    我創建了一個項目然后再加了一個readme初始化項目了。

    然后貧僧先用http下載項目:

    新建文件夾-> git->clone->那個地址


    華麗的分割線


    接下來講講用ssh,他們說用ssh方式更囂張

    首先配置key

    去git的安裝目錄找到usr/bin

    C:\Program Files\Git\usr\bin然后地址欄輸入cmd彈出大黑框執行:

    ssh-keygen -t rsa -C 'xxx@xxx.com'

    一路牛b加閃電按回車在用戶目錄下C:\Users\sht\.ssh

    生成了一個id_rsa.pub這個文件:

    編輯器打開復制內容然后到gatlib的ssh秘鑰中添加

    搞到那個大框框里面然后add成功之后去項目里面

    復制新建文件夾clone直接ssh方式克隆,ohyes!

    報錯了:

    他說我沒權限,經鑒定是小王八git配置問題,我們來配置:

    更改完clone:

    gameover!

    總結

    以上是生活随笔為你收集整理的gitlab git clone 卡住_gitlab从入门到绝望的全部內容,希望文章能夠幫你解決所遇到的問題。

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