V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
SimleCp
V2EX  ›  git

在 Ubuntu 上搭建 git 服务器, git clone 有问题

  •  
  •   SimleCp · 2017-10-09 10:26:37 +08:00 · 2342 次点击
    这是一个创建于 2362 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我在 Ubuntu 上搭建了 git 服务器, git clone 的时候一直说没有权限或者文件夹不存在, 后来我尝试用 root 登录, ls -a, 显示的文件夹都是对的. 然后我用 git 登录, ls -a, 没有找到我自己创建的文件夹, 导致 git clone 一直找不到目标文件夹. 我换成 root 用户去 git clone, 没问题. 现在我该怎么办?.
    12 条回复    2017-10-10 10:44:23 +08:00
    we000
        1
    we000  
       2017-10-09 10:56:53 +08:00
    需要学习 Linux.

    改文件权限, 让操作 git 的用户可以读(本地? ssh?)
    jinhan13789991
        2
    jinhan13789991  
       2017-10-09 10:59:54 +08:00
    建议使用 docker 安装 gitlab。非常快速方便
    lhc70000
        3
    lhc70000  
       2017-10-09 11:03:12 +08:00
    如果不需要提供公开下载的话可以试试 gitolite
    youyoumarco
        4
    youyoumarco  
       2017-10-09 11:27:43 +08:00
    可以用 gitlab 代替
    Norie
        5
    Norie  
       2017-10-09 11:43:02 +08:00
    chown -R git:git yourdir
    zyq2280539
        6
    zyq2280539  
       2017-10-09 11:50:57 +08:00
    来来来使用 gogs,十分钟搞定 git 系统,全面兼容,要求配置非常低,比 gitlab 要求更低,树莓派都可以轻松跑起来
    relaxchen
        7
    relaxchen  
       2017-10-09 16:26:02 +08:00
    既然有人推荐了 GOGS,那我就推荐 Gitea 吧,搞事情
    SimleCp
        8
    SimleCp  
    OP
       2017-10-10 08:58:20 +08:00
    @we000 权限, 如下, srv 显示 git, 但是用 ssh 登录 git 账户, ls -a 里面还是没有 srv 这个文件夹.
    total 68
    drwx------ 8 root root 4096 Oct 8 08:57 ./
    drwxr-xr-x 23 root root 4096 Jul 26 00:47 ../
    -rw------- 1 root root 2441 Oct 9 01:15 .bash_history
    -rw-r--r-- 1 root root 3106 Oct 7 02:08 .bashrc
    drwx------ 2 root root 4096 Jul 26 00:49 .cache/
    drwx------ 2 root root 4096 Oct 7 01:53 .gnupg/
    -rw------- 1 root root 244 Oct 7 03:00 .mysql_history
    -rw-r--r-- 1 root root 221 Oct 7 02:10 .profile
    drwxr-xr-x 3 git git 4096 Oct 8 08:39 srv/
    SimleCp
        9
    SimleCp  
    OP
       2017-10-10 08:58:47 +08:00
    @Norie 看 8 楼
    SimleCp
        10
    SimleCp  
    OP
       2017-10-10 09:01:40 +08:00
    @jinhan13789991 内存只有 1g 自己搭个小服务器玩 没必要...
    shingle
        11
    shingle  
       2017-10-10 10:02:51 +08:00
    @SimleCp 内存 1g 使用 docker 没什么不妥啊,我的 1g 服务器已经运行了 8 个容器了
    SimleCp
        12
    SimleCp  
    OP
       2017-10-10 10:44:23 +08:00
    @shingle 同时我们强烈推荐承载 GitLab 运行的服务器 至少分配 4GB 的内存 给 GitLab.
    我也很心痛...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4593 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:05 · PVG 18:05 · LAX 03:05 · JFK 06:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.