美文网首页
Xcode git The remote repository

Xcode git The remote repository

作者: 大城子 | 来源:发表于2018-12-14 10:14 被阅读153次

错误原因

最近在写一个视频播放器的demo, 把视频文件拖到项目中, 发现怎么也没办没法进行push, 一直被github拒绝, 各种搜索, 发现github不接受大于147兆的文件的push

解决办法

由于本地git仓库已经有大文件的相关历史记录(尽管我已经把大文件删除了, 但是git的commit操作实际并未删除文件, 只是记录操作行为), 因此需要把git仓库中的大文件-视频删除, 即重写git的历史记录, 从所有提交中删除一个文件

重写git的历史记录

从所有提交中删除一个文件

##在终端中执行
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch ADPPlayer/sao2.mp4' --tag-name-filter cat -- --all

###执行过程
bogon:ADPPlayer LittleP$ git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch ADPPlayer/sao2.mp4' --tag-name-filter cat -- --all
Rewrite 77d3b69f8d5440c5fb044aca5dbe372a4a2db983 (1/4) (0 seconds passed, remainRewrite 6e3bd6bde6d6344514df8510e63890a1decc228c (2/4) (0 seconds passed, remaining 0 predicted)    rm 'ADPPlayer/sao2.mp4'
Rewrite 390e007de100c6c3990a651fb93c8277b0ad4b9f (3/4) (0 seconds passed, remainRewrite d68b521ea4bb36979f2c886db51bb4ef1aa15e51 (4/4) (0 seconds passed, remaining 0 predicted)    
Ref 'refs/heads/master' was rewritten
Ref 'refs/remotes/origin/master' was rewritten

相关文章

  • Xcode git The remote repository

    错误原因 最近在写一个视频播放器的demo, 把视频文件拖到项目中, 发现怎么也没办没法进行push, 一直被gi...

  • Git学习(2018-08-12)

    Git创建local repository和remote repository 参考:①Git的使用--如何将本地...

  • git/bitbucket

    delete file/directory in remote repository 查看分支:git branc...

  • git 命令多人协作总结

    git pull 出错 fatal: Could not read from remote repository....

  • git

    1、git clone -b branchName [remote repository address] 克隆指...

  • Pycharm出现Git Pull Failed: Could

    问题 Git Pull Failed: Could not read from remote repository...

  • Git 命令总结

    git pull 出错 fatal: Could not read from remote repository....

  • git 使用日记

    git 克隆远程指定分支命令如下: git clone -b [remote repository addre...

  • git commands

    1. To see the URL of local repository git remote show ori...

  • git - remote:Repository not foun

    公司一同事离职了,git权限被禁掉了,此时,在此电脑上登录自己的git账号更新代码时,报了如下错误: git - ...

网友评论

      本文标题:Xcode git The remote repository

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