mkusz / mkdocs-publisher

Publisher for MkDocs - a set of plugins for content creators
https://mkusz.github.io/mkdocs-publisher/
MIT License
44 stars 1 forks source link

.obsidian and .pub_min_cache not being ignored via .gitignore file. #54

Closed AgedLace closed 9 months ago

AgedLace commented 9 months ago

Bug description

Problem description

.gitignore is not ignoring .obsidian or .pub_min_cache

Expected behaviour

both of these directories should be ignored by .gitignore

Reproduction steps

I've tried multiple times to verify there are no typos. I even copied part of your .gitignore file, but these two folders are still being pushed to github instead of being ignmore.

Operating system

Python version

Link to git repository

https://github.com/AgedLace/MkDocs-Publisher-v1.2.0

Log output

Github gives me an error that this file is too long.

Contact details

agedlace@yandex.com

mkusz commented 9 months ago

This is not this project problem 😉

In fact this is an expected behaviour of git. When you add some directory to the repo and in next commit/push add the same direcotry to the .gitignore you will see the described problem. To make it working (without removing files locally) you have to manually use one of the following commands:

git rm --cached some_file
git rm --cached -f force_removal_of_some_file

git rm --cached -r some_directory
git rm --cached -rf force_removal_of_some_directory

After that you have to commit changes and push them to the repo.

AgedLace commented 9 months ago

I'm sorry my lack of tech understanding is causing you more work! I spent many hours trying to figure this out. Thank you for the solution!!!

mkusz commented 9 months ago

Don't worry, it's not an obvious thing for non-tech-savvy people, so I fully understand your problems (it's why I write a solution for your problem).