• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ethusdt
0.01D
V2EX  ›  程序员

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

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