zoukankan      html  css  js  c++  java
  • 改写历史,永久删除git库的物理文件

    leetcode题解https://github.com/DaI253/leetcode-cpp,包含大量pdf历史文件,准备清理其中的历史文件,缩小项目体积。

    http://my.oschina.net/jfinal/blog/215624 

    git filter-branch --tree-filter 'rm -f *.pdf' --tag-name-filter cat -- --all
    git push origin --tags --force
    git push origin --all --force

    另一个常用命令,查看文件夹容量

    du查看目录大小,df查看磁盘使用情况。
    我常使用的命令(必要时,sudo使用root权限),
    1.查看某个目录的大小:du -hs /home/master/documents
     查看目录下所有目录的大小并按大小降序排列:sudo du -sm /etc/* | sort -nr | less
    2.查看磁盘使用情况(文件系统的使用情况):sudo df -h
    df --block-size=GB
     
    -h是使输出结果更易于人类阅读;du -s只展示目录的使用总量(不分别展示各个子目录情况),-m是以MB为单位展示目录的大小(当然-k/-g就是KB/GB了)。
    更多信息,还是man du 和 man df 来获得吧。

    Ignore files that have already been committed to a Git repository

    http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository

    如何删除github上的一个项目的内容,重新提交所有内容

    http://segmentfault.com/q/1010000000250171

    git rebase 更改历史树

    http://www.cnblogs.com/dabaopku/archive/2012/06/24/2559652.html

  • 相关阅读:
    Hadoop学习之安装HDFS
    常见的6种数据结构
    maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean
    jquery解决js对象、数组赋值时的引用传递
    405 method not allowed(方法不被允许)
    身份证件号 正确性检查方法
    svn 提交信息模板
    idea 使用说明
    java-System类
    java-Integer 类
  • 原文地址:https://www.cnblogs.com/daijkstra/p/4633493.html
Copyright © 2011-2022 走看看