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

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

  •  
  •   az22c · Jul 21, 2022 · 3208 views
    This topic created in 1420 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
        1
    renmu123  
       Jul 21, 2022 via Android
    真没试过,你重新建个远程仓库,再拉下来吧
    IGJacklove
        2
    IGJacklove  
       Jul 21, 2022 via iPhone
    你先上传到可以连接的仓库再拉下来不就可以了……
    alvinbone88
        3
    alvinbone88  
       Jul 21, 2022   ❤️ 1
    以前试过,直接拷肯定会报错,最后 git clone --bare 创建临时仓库再打包传过去的
    az22c
        4
    az22c  
    OP
       Jul 21, 2022
    @renmu123
    @IGJacklove 几个 G 体积的传不到线上。有一百来个 git 项目

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