I pushed from the production server to a repo that I just created. The server had a .gitignore but I think that didn't take effect because it wasn't in bitbucket yet. (I might be wrong on that?)
Here is what I did
The gitignore that was on the server ended up in the repo as expected. It contained entries such as
However the repo now has /log, /tmp etc. It is extremely slow.
How do I fix this? I've been looking at git rm -r --cached but I don't think that will work with the folders.
I've also seen git filter-branch. I'm a bit unsure of the exact syntax I need.
To summarize: My goal is to remove the folder/files that were listed in the original .gitignore from the repo. There were previous commits that show from the server. However, if I click on the commit link I get "something went wrong". I'm not particularyly worried about that right now.
What I want to do is get rid of the folders and files that shouldn't be in the repo.
thanks,
chris
Hi Christopher! The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked and looks like in your case they were already tracked. To stop tracking a file that is currently tracked, you need to use git rm --cached. For more details you can read Git ignore and Git rm.
This blog contains examples that might help you. As always, it's important to have a backup of your data before performing this kind of operations if you're not familiar with them.
Hope that helps!
Ana
I'm going to try that. I was wondering though, if that would reduce the repo size from the 1 GB that it is currently to the 100k or so it should be.
From what I understand, there is a possibility that the folders I would be removing from the repo would still exist in previous commits.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.