Closed back-lacking closed 4 months ago
I assume you already committed the file before adding it to .gitignore. You need to run git rm --cached <file>
to remove it from the repo.
I assume you already committed the file before adding it to .gitignore. You need to run
git rm --cached <file>
to remove it from the repo.
so ive done that, tried it for a few days, made a few changes, and i still see the file being modified. im looking at the commits on gitlab (obsidian notes stored on there), i would see the workspace.json file as a file that is modified. ive tried to remove workspace.json from the gitlab repo, but that didnt succeed.
I can assure you that if you properly write your .gitignore file and to the rest correct, it will work. Did you commit after running git rm --cached .obsidian/workspace.json
? What do you mean with deleting the file from gitlab didn't work? If you run the rm
command locally, commit and push, the file should be removed on gitlab as well. If you now do some changes in obsidian, the workspace.json file should be ignored.
Im not sure if i pushed the change. I will look at the commit log on gitlab. I will do it again in a couple minutes in order to confirm. I commited and pushed the gitignore seperately. Ran the git rm command, not sure if i pushed the change.
The git ignore is just one line, .obsidian/workspace.json
here is the commits related to changing the gitignore and removing workspace.json.
here is the commit related to the gitignore.
But is the file now deleted in the repo on gitlab? You deleted the workspace file before fixing your .gitignore
. If not try again to delete the workspace file via my provided rm --cached command.
i may be very dumb just checked the gitlab repo, and workspace.json isnt there
as for how i deleted the workspace.json file, i deleted it from the gitlab repo using gitlabs "delete file" option
basically, went to the file, and pressed delete. which automatically made a commit for deleting the file
also, im checking the other commits i made that day, seems like the workspace.json wasnt included in the commits.
there are a few commits that did include changes to workspace.json. (made after the commits for deleting the json and changing git ignore). i also use this on windows so ill see if the same issue is replicated on windows.
I'm really confused by your new edits. I see you are not familiar with git and this is not a support forum for git. So I will try it last time. Go into terminal and delete the workspace.json file like I told you. The file should be marked as deleted now in git status. Now commit and push the changes. The file should now also be gone from the gitlab repo.
shit (same thing on windows)
As this is not an issue with the plugin, please try to find other sources on the internet to fix your issue. Like this one: https://www.atlassian.com/git/tutorials/saving-changes/gitignore I can't explain you every step on how to use git, now that you are even talking about multiple machines.
fair enough, i will take a look at that article when i can.
Describe the bug
The error is exactly what it says on the title. I listed one file in my gitignore (
.obsidian/workspace.json
) however that one particular file wont be ignored. that would cause pulls and pushes to fail due to that one file not being ignored and file conflicts. (this issue is also present on windows, same behavior)Relevant errors (if available) from notifications or console (
CTRL+SHIFT+I
)Steps to reproduce
setup remote git repo add
.obsidian/workspace.json
to git ignore make whatever notes you need/want press the "backup" button see git error due to file conflicts (windows sees the same process)Expected Behavior
workspace.json gets ignored when pushing changes and pulling changes.
Addition context
No response
Operating system
Linux
Installation Method
Flatpak
Plugin version
2.22.0