V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ethusdt
0.01D
V2EX  ›  程序员

Git 文件库执行了 chmod 操作后所有文件都变为 modified

  •  
  •   ethusdt ·
    FaiChou · Oct 9, 2017 · 5123 views
    This topic created in 3122 days ago, the information mentioned may be changed or developed.

    由于某次项目推送失败,于是执行了一遍$sudo chmod -R 777 project。

    于是项目中出现几百个 tracked/modified 文件,所有的项目文件都 modifed 了,包括.gitignore, .eslintrc, debug.log, README.md, allsrc.

    改怎么处理? 删掉库重新 down 一遍吗

    18 replies    2017-10-10 04:40:26 +08:00
    atan
        1
    atan  
       Oct 9, 2017   ❤️ 4
    git config core.filemode false
    ethusdt
        2
    ethusdt  
    OP
       Oct 9, 2017
    @atan 谢谢 可以了
    lcdtyph
        3
    lcdtyph  
       Oct 9, 2017 via iPhone
    一言不合就 777 …
    monsterxx03
        4
    monsterxx03  
       Oct 9, 2017   ❤️ 2
    神烦碰到问题无脑 sudo,无脑 777 的,以后要吃大亏
    GOOD21
        5
    GOOD21  
       Oct 9, 2017
    @monsterxx03 还有无脑 rm 的
    motecshine
        6
    motecshine  
       Oct 9, 2017
    是什么需求 让你 chmod 777 文件
    ethusdt
        7
    ethusdt  
    OP
       Oct 9, 2017
    @motecshine git unpack failed unable to create temporary object directory
    SilentDepth
        8
    SilentDepth  
       Oct 9, 2017
    777 就罢了,为什么要 -R
    ethusdt
        9
    ethusdt  
    OP
       Oct 9, 2017
    @SilentDepth recursively
    SilentDepth
        10
    SilentDepth  
       Oct 9, 2017
    @FaiChou #9 我知道 -R 是什么作用,我是说只修改根目录的属性不行吗?
    0x4b0082
        11
    0x4b0082  
       Oct 9, 2017
    777 艺高人胆大
    ethusdt
        13
    ethusdt  
    OP
       Oct 9, 2017
    @SilentDepth 哈,其实我也知道你是知道-R 作用的。我只是想回答 我就是想递归修改子路径下文件,彻底一点,因为我不想查到哪个路径下哪个文件权限问题导致推送失败,所以索性都改了。作为前端开发,改权限应该不是忌讳的吧?都忌讳无脑 rm 无脑 777 无脑 cv。。。其实忌讳的是无脑,而不是某个命令吧。
    SilentDepth
        14
    SilentDepth  
       Oct 9, 2017
    改权限的忌讳跟前端有啥关系…… temporary object directory,难道不是在 .git 目录下吗?改根目录属性,至多加上 .git
    ethusdt
        15
    ethusdt  
    OP
       Oct 9, 2017 via iPhone
    @SilentDepth 问题已解决,感谢回复
    zsj950618
        16
    zsj950618  
       Oct 9, 2017 via Android
    害人不浅,毁人不倦,2333
    sampeng
        17
    sampeng  
       Oct 9, 2017
    无脑 777 都是网上各种复制粘贴的教程闹的
    msg7086
        18
    msg7086  
       Oct 10, 2017 via Android
    没权限是 owner 闹的吧,改 mode ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   994 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 20:12 · PVG 04:12 · LAX 13:12 · JFK 16:12
    ♥ Do have faith in what you're doing.