How can I ignore big files and push to git repo

Cagri

Before, I used git locally without using .gitignore Afterwards, I created an .gitignore file, and write all unnecessary files in it. When I push them to git repo, fatal: The remote end hung up unexpectedly error appears.

I dont want to push ignore files, but, somehow git tries to push them to repo.

Please help me, what is my fault? Thanks

Ionică Bizău

GitHub has a nice article on this. You basically want to remove the files from Git history, but not from the file system.

  • If your file was pushed in your last commit, you can do:

    git rm --cached path/to/your/big/file
    git commit --amend -CHEAD
    git push
    
  • If not, they recommend using BFG–a tool for cleaning up repositories (alternative to git-filter-branch):

    bfg --strip-blobs-bigger-than 50M
    

    This will remove files bigger than 50M.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

git - How can I tell where a repo will "push" to?

From Dev

How can I push a git repo to a remote server through ssh?

From Dev

git - How can I tell where a repo will "push" to?

From Dev

How can I push a git repo to a remote server through ssh?

From Dev

How can I automatically push the data to a git-repo when it's pushed to a bare git repo?

From Dev

How can I automatically push the data to a git-repo when it's pushed to a bare git repo?

From Dev

How can I tell git to ignore LibreOffice lock files?

From Dev

Git - How can I ignore a file of my repo without removing it from the repository?

From Dev

Git - How can I ignore a file of my repo without removing it from the repository?

From Dev

How can I change Git username when I want to pull or push repo?

From Dev

How can I change Git username when I want to pull or push repo?

From Dev

How can I push certain files to origin/master in Git?

From Dev

What files of a meteor project I should push to a Git repo?

From Dev

How can I auto-deploy my git repo's submodules on push?

From Dev

Can I add a file to my local Git repo but not push it to remote

From Dev

How do I ignore everything in my repo except a few files?

From Java

How do I ignore files in a directory in Git?

From Dev

CtrlP: ignore files in subdirectory within a git repo

From Dev

Ignore OSX hidden "._" files from git repo

From Dev

Git repo default ignore files permissions

From Dev

How can I transport a Git repo from one PC to another when the files are (probably) current?

From Java

How can I push to my fork from a clone of the original repo?

From Dev

Pycharm -- how can I push a local project to a remote organization repo?

From Dev

How can I push a branch into a separate remote repo?

From Dev

how can I add git submodule into git repo as normal directory?

From Dev

How do I change the git repo but keep the files?

From Dev

Git push doesn't ignore files in .gitignore

From Dev

Git push doesn't ignore files in .gitignore

From Dev

Can't push a git repo on a local server

Related Related

  1. 1

    git - How can I tell where a repo will "push" to?

  2. 2

    How can I push a git repo to a remote server through ssh?

  3. 3

    git - How can I tell where a repo will "push" to?

  4. 4

    How can I push a git repo to a remote server through ssh?

  5. 5

    How can I automatically push the data to a git-repo when it's pushed to a bare git repo?

  6. 6

    How can I automatically push the data to a git-repo when it's pushed to a bare git repo?

  7. 7

    How can I tell git to ignore LibreOffice lock files?

  8. 8

    Git - How can I ignore a file of my repo without removing it from the repository?

  9. 9

    Git - How can I ignore a file of my repo without removing it from the repository?

  10. 10

    How can I change Git username when I want to pull or push repo?

  11. 11

    How can I change Git username when I want to pull or push repo?

  12. 12

    How can I push certain files to origin/master in Git?

  13. 13

    What files of a meteor project I should push to a Git repo?

  14. 14

    How can I auto-deploy my git repo's submodules on push?

  15. 15

    Can I add a file to my local Git repo but not push it to remote

  16. 16

    How do I ignore everything in my repo except a few files?

  17. 17

    How do I ignore files in a directory in Git?

  18. 18

    CtrlP: ignore files in subdirectory within a git repo

  19. 19

    Ignore OSX hidden "._" files from git repo

  20. 20

    Git repo default ignore files permissions

  21. 21

    How can I transport a Git repo from one PC to another when the files are (probably) current?

  22. 22

    How can I push to my fork from a clone of the original repo?

  23. 23

    Pycharm -- how can I push a local project to a remote organization repo?

  24. 24

    How can I push a branch into a separate remote repo?

  25. 25

    how can I add git submodule into git repo as normal directory?

  26. 26

    How do I change the git repo but keep the files?

  27. 27

    Git push doesn't ignore files in .gitignore

  28. 28

    Git push doesn't ignore files in .gitignore

  29. 29

    Can't push a git repo on a local server

HotTag

Archive