I've seen on the threads here that PyCharm git integration does not offer a 'Remove' command so you have to remove files from outside the IDE (or in terminal window) and then re-add and commit them.
However, I'm getting errors in the workflow when trying to commit/push to GitHub and I'm unclear what I'm doing wrong. Here's what I've done:
- Got error from trying to push a large (> 200MB) file to GitHub via IDE
- outside of the IDE, did git rm --cached <filename> to remove the file from the repository but leave it in the filesystem. This works fine.
- IDE updates: filename in project view goes from white (committed) to red (untracked)
- tried doing an Add within the IDE, and the file gets re-staged for commit, turns white again
- committing and pushing directory causes original error
So, I tried everything outside the IDE:
- did git rm --cached <filename> and again IDE updates
- outside IDE did git commit -a -m "message"
- commit succeeds
Then, I edited another file in the IDE and tried committing/pushing it. The original error (file too big from GitHub) came back saying that the original huge file was in the commit/push.
I don't get it.
How exactly are you supposed to:
- remove a file you added by mistake to git in the IDE from the repository
- have the changes actually reflected in the IDE
- be able to push that change to GitHub (or another remote I guess)