0

Currently, I have, on local branch master, a folder structure like:

project
    models
    web
        app
        app_env (vritualenv)
        requirements.txt

I want to push everything besides models and app_env code to app_demo, a remote branch under origin.

I did cd to project and did:

git add .
git rm --cached -r models
git rm --cached -r web/app_env
git commit -m "Please work"
git push origin master:web_demo

But got

remote: error: File models/variables/variables.data-00000-of-00001 is 986.28 MB; 
this exceeds GitHub's file size limit of 100.00 MB

! [remote rejected]   master -> app_demo (pre-receive hook declined)

Because some file under models was too big. I thought I removed it already!? Why is this happening?

Michael Sun
  • 189
  • 3
  • 10
  • The large file is part of your branch's history, so `rm --cached` is not enough. You need to remove all traces of this file from your history. See filter branch or rebase for possible options. – Tim Biegeleisen Feb 11 '19 at 03:38

1 Answers1

0

Instead of using git add . You should add individual files or directories like

git add web/app

If you do a git status , you'll get all the files which are unstaged, then you can select individual files and add them one by one.

Prasheel
  • 985
  • 5
  • 22