git 管理 Linux 文件系统

  • git 管理 Linux 文件系统有两个问题,第一个是 Linux 根文件系统的 root 权限问题,第二个就是git不上传空文件问题。

  • 一、 root权限问题的话就得在 root 用户下git , 只要 su 一下就行了。

  • 二、git 部上传空文件问题: 参考: http://www.cnblogs.com/zengjfgit/p/6243817.html

  • 原理是将所有的空文件都加一个 .gitignore 文件

    find . -name .git -prune -o -type d -empty -exec touch {}/.gitignore \;
    find . -name .git -prune -o -type d -empty -exec touch {}/.emptyFolders \;
posted @ 2017-11-13 16:52  陈富林  阅读(912)  评论(0编辑  收藏  举报