Gitignore

I clone repo from GitLab, which has not .gitignore file and i add it myself, but its not work

Pleas, how can I fix it?

Yellow means modified. A gitignore doesn’t ignore already tracked files.

See: https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore

However that won’t remove it from your history. This tool can https://rtyley.github.io/bfg-repo-cleaner/

Hello Daniel.
first I download and install java runtime environment, then download bfg.jar file and open Git terminal in that directory where bfg.jar file was downloaded and write below command:


in “some-big-repo.git” indicate my local mirror clone repo directory path. but git dont recognize java command
what i did wrong?

What did you enter exactly? And what was the exact error?

I dont know why but today its work, but now I have second issue.
when i executed bfg.jar command. it create new repo.report folder in my repo directory
and now can not execute git gc commant, its require correct directory and its little confuse:

  1. i have to go into repo folder?
  2. which repo folder i have to use?

my bfg.jar destination path was:
InsideRepo_2

I choose the first folder, but now i have malloc issue:
malloc

How much RAM do you have?

16Gb 3200mhz

I get some different errors, but malloc is also problem

Errors

I reClone repo and tried again but I got same issue. after that I set some config and its work

Solution

but now I indicate 50m size. and what this means ? each file that up 50m will be ignored?

Size

before I push want to ask is everything correct ?
because I dont want to destroy something

Not ignored. Removed from the history. Ignoring just prevents a new file from being added by accident or showing up in diff/status commands.

I would push to another branch or remote just in case. Then clone that to a separate local repo and test everything works as expected and that the history is correct.

After checking all of that you should be good to push to the original though as now the histories are different due to the removal of files you would need to use force push.

I solve it.
Thank you Daniel

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.