git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
az22c
V2EX  ›  git

试过跨平台拷贝 git 管理的项目吗?大佬们

  •  
  •   az22c · Jul 21, 2022 · 3596 views
    This topic created in 1566 days ago, the information mentioned may be changed or developed.

    一个 git 管理的项目,线上的远程仓库已经连不上了。我把这个项目从 macOs 拷贝到 Windows 上。打开看看 git 信息还能不能正常读取。

    Windows 上项目里面的.git 文件夹还在,但是用 vscode 或者 powershell 这些已经读取不到 git 的信息了 或者 "能读取到不报错但是 png 文件在 git 对比中显示已修改"。

    Supplement 1  ·  Jul 21, 2022
    并不是只有 1 个 git 项目:这里是以 1 个作为例子而已。实际我是有 100+个 git 项目需要拷贝,加起来体积好几个 G 。
    13 replies  •  2022-07-22 10:45:52 +08:00
    renmu123
    renmu123
    Jul 21, 2022 via Android
    1
    真没试过,你重新建个远程仓库,再拉下来吧
    IGJacklove
    IGJacklove
    Jul 21, 2022 via iPhone
    2
    你先上传到可以连接的仓库再拉下来不就可以了……
    alvinbone88
    alvinbone88
    Jul 21, 2022❤️1
    3
    以前试过,直接拷肯定会报错,最后 git clone --bare 创建临时仓库再打包传过去的
    az22c
    az22c
    OP
    Jul 21, 2022
    4
    @renmu123
    @IGJacklove 几个 G 体积的传不到线上。有一百来个 git 项目

    除非本地模拟一个远程项目
    IGJacklove
    IGJacklove
    Jul 21, 2022 via iPhone
    5
    @az22c 很大吗?传码云 gitlab 这种平台不就可以了?可以考虑写个脚本处理吧
    FYFX
    FYFX
    Jul 21, 2022❤️6
    6
    你 mac 和 windows 连到同一个局域网 直接 git clone <mac 用户名>@<mac_ip>:<仓库的绝对路径> 就好了啊
    大概可以参考这个 https://www.liaoxuefeng.com/wiki/896043488029600/899998870925664
    lostpg
    lostpg
    Jul 21, 2022 via Android
    7
    用 git bundle 打包应该更好吧
    Les1ie
    Les1ie
    Jul 21, 2022
    8
    仓库很大需要分发的话,楼上的建议我觉得可行,用 git bundle
    https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E6%89%93%E5%8C%85
    duoduoeeee
    duoduoeeee
    Jul 21, 2022 via iPhone
    9
    我都用 rsync
    Alliot
    Alliot
    Jul 21, 2022❤️1
    10
    简单的方法就是 写个脚本批量替换一下 [project]/.git/config 里的 remote 地址到新的仓库,然后全部 push 一次。。
    msg7086
    msg7086
    Jul 22, 2022
    11
    我 Windows 和 Linux 之间有软件实时同步,同一个.git 同时在两边用,没遇到过什么问题。
    bluesky139
    bluesky139
    Jul 22, 2022 via Android
    12
    想省事直接 tar 打包过去,我认为应该是可行的。
    waterlaw
    waterlaw
    Jul 22, 2022 via Android
    13
    3 楼意见可以采纳
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2126 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 16:22 · PVG 00:22 · LAX 08:22 · JFK 11:22
    ♥ Do have faith in what you're doing.