linux git 推送空文件夹

  • 参考链接:http://www.cnblogs.com/chenfulin5/p/7827024.html

  • 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 \;

猜你喜欢

转载自blog.csdn.net/qq_39101111/article/details/79480033