美文网首页
文件权限变更后的 Git 配置

文件权限变更后的 Git 配置

作者: 申申申申申 | 来源:发表于2017-05-12 14:57 被阅读930次

某些时候修改了文件权限后,git status 会发现许多文件都发生了变化

tianqingsedengyanyu:qifa fengfeng$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app/admin/control/login.php
        modified:   app/member/control/connect_sms.php
        modified:   temp/cache/adv/index.html
        modified:   temp/cache/index.html
        modified:   temp/cache/index/index.html
        modified:   temp/cache/phpqrcode/index.html
        modified:   temp/cache/rec_position/index.html
        modified:   temp/session/index.html

no changes added to commit (use "git add" and/or "git commit -a")
tianqingsedengyanyu:qifa fengfeng$ 

查看文件修改

tianqingsedengyanyu:qifa fengfeng$ git diff temp/cache/phpqrcode/index.html
diff --git a/temp/cache/phpqrcode/index.html b/temp/cache/phpqrcode/index.html
old mode 100644
new mode 100755
tianqingsedengyanyu:qifa fengfeng$ 

因为修改了项目权限 chmod -R 777 /Users/fengfeng/Desktop/bbc

使用git忽略掉权限变化

.git/config => filemode = false

tianqingsedengyanyu:qifa fengfeng$ vim .git/config 

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = false
[remote "origin"]
        url = http://1**.224.27.8:88/****_team/***.git
        fetch = +refs/heads/*:refs/remotes/origin/*
        pushurl = http://1**.224.27.8:88/****_team/***.git
[branch "master"]
        remote = origin
        merge = refs/heads/master
[branch "dev"]
        remote = origin
        merge = refs/heads/dev

再次查看

tianqingsedengyanyu:qifa fengfeng$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app/admin/control/login.php
        modified:   app/member/control/connect_sms.php

no changes added to commit (use "git add" and/or "git commit -a")
tianqingsedengyanyu:qifa fengfeng$ 

 不定期更新 不合适的地方 还请指点~ 感激不尽

相关文章

  • git忽略文件权限变更的修改

    1. 查看git的config配置 2.忽略当前目录下git文件权限变更

  • 文件权限变更后的 Git 配置

    某些时候修改了文件权限后,git status 会发现许多文件都发生了变化 查看文件修改 因为修改了项目权限 ch...

  • git配置

    git tips: 设置filemode,避免NTFS文件权限变更引起的修改[https://www.jiansh...

  • Permission denied error

    go get 后出现权限问题 文件权限问题没有权限写入按 sudo 方式运行命令 git 权限问题没有权...

  • GIT小知识

    1、git中可以加入忽略文件权限的配置, 具体如下: 查看: 2、配置Git支持大小写敏感和修改文件名中大小写字母...

  • git常用命令

    git中可以加入忽略文件权限的配置,具体如下: 本地最新代码强推到git远程仓库的笔记 解决:git branch...

  • git文件权限修改引起的冲突及忽略文件权限的办法

    git默认:文件权限变更也算差异的一部分,所以如果文件权限更改了会导致更新失败或者更新发生冲突。 进入到项目目录运...

  • centos下配置git ssh

    centos下配置git ssh 拿到root权限 输入password 获得root权限后,以下的$符号变成#符...

  • linux--chmod

    chmod 用来变更文件或目录的权限 补充说明 chmod命令 用来变更文件或目录的权限。在UNIX系统家族里,文...

  • load key invalid format jenkins

    jenkins 配置完后,git报权限失败 gitlab中配置的ssh是通过:cat ~/.ssh/id_rsa....

网友评论

      本文标题:文件权限变更后的 Git 配置

      本文链接:https://www.haomeiwen.com/subject/xlwztxtx.html