Using Obsidian Git, I inadvertently tried to push a > 600mb attachment folder (along with usual changes of some “.md” files that needed to be backed-up). It would have taken forever so I just killed the process while Obsidian Git was pushing (probably worst idea ever).
Then, on Github, I added a .gitignore file with the path of attachment folder to be excluded and pulled the changes to my local repo using command line.
Now, how can I properly exclude this “attachment” folder since it was already committed to my local repo ?
I was thinking of something like
git rm ATTACHMENT_PATH, but wouldn’t Obsidian Git try to add back this folder each times it tries to push ? Will the .gitignore file prevent this after the
git rm ?
I hope this is not too confuse, I’m new to git.
Any help is welcome !
Thank you. Well, after doing this procedure and trying to push, even if a diff does not show the files of the attachment folder, for an unknown reason it still tries to push them…
I think it’s due to the fact that attachment folder was not added in the latest commit but in earlier commit, thus those need to be cleaned too ? Not sure yet how to proceed.
Or maybe aborting the push was not a good idea ?
Make sure your .gitignore is correct for ignoring a directory.
Have you had any luck with this?
I think my problem had to do with cleaning that big folder from my history of commit (see Removing sensitive data from a repository - GitHub Docs).
Unfortunately, I typed too many Github command that I don’t master enough, and at some points it became a mess so that it was much easier to start repo from scratch.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.