.stignore for a folder includes the first level after root, and then doing ignores on the 2nd level

so i have a bit of a weird case.
I want to have my stignore sync everything on the first and 2nd level of sub dirs, but on the 3rd level ignore specific folders/files i have a code projects folder, which are then catagorized by language/IDE type, and then contain the project folders themselves.
here is my directory structure

Code Projects\ (root)
  Java\ (sublevel 1)
    project1\ (sublevel 2)
      .vscode\ (sublevel 3)
      .idea\
      \\ actual source code/other files i have
    project2\
      .vscode\
      .idea\
      \\ actual source code/other files i have
  C++\
    project1\
      .vscode\
      .idea\
      \\ actual source code/other files i have
    project2\
      .vscode\
      .idea\
      \\ actual source code/other files i have

here is what i want my .stignore to do

Code Projects\ (root)
  Java\ # sync
    project1\ # sync
      .vscode\ # dont sync
      .idea\ # dont sync
      \\ actual source code/other files i have # sync
    project2\ # sync
      .vscode\ # dont sync
      .idea\ # dont sync
      \\ actual source code/other files i have # sync
  C++\ # sync
    project1\ # sync 
      .vscode\ # dont sync
      .idea\ # dont sync
      \\ actual source code/other files i have # sync
    project2\ # sync
      .vscode\ # dont sync
      .idea\ # dont sync
      \\ actual source code/other files i have # sync

here is the relevant bits of my stignore

**/.idea
**/.kotlin
**/.gradle

can someone help me make an stignore that does that?

How about just

.vscode
.idea

?

Alternatively, if you want to ignore those only on “sublevel 3”, then maybe

/*/*/.vscode
/*/*/.idea

?

4 Likes

i tried doing that, it didnt seem to do much. applied to both my computers, but it didnt change much, would still show out of sync

I think you should test with an unshared folder first. That way, you can verify whether the ignore patterns work by checking the folder’s local state in the Web GUI.

the syncing now works properly after pausing sync on both sides, deleting the project folder on both sides (saved the good copy on my linux box before hand), restarting the sync on both sides, and then readding the files on one side and letting it sync to the other (also edited the stignore according to your messages, ignoring .idea, .gradle) and the other files i wanted synced synced properly.