if i pull like that it told me “fatal: can’t squash-merge: ‘resources/[standalone]/PolyZone’ was never added.” I figured out thats because the brackets in “[standalone]” and i tried to escape them with backslashes or double backslashes or \Q or \E or using ’ ’ or " " but i can not pull with that path. Why can i add a subtree to this path but i can not pull it with that path, i need that brackets in that directory names?
i tried to escape them with backslashes or double backslashes or \Q or \E or using ’ ’ or " " but i can not pull with that path. Why can i add a subtree to this path but i can not pull it with that path, i need that brackets in that directory names?
Check Shell Escaping: If neither double nor single quotes work, you might be running into issues with how your shell interprets the command. You can try escaping the brackets with backslashes:
Rename the Directory Temporarily: As a last resort, you could temporarily rename the directory to remove the brackets, perform the pull, and then rename it back:
mv resources/[standalone] resources/standalone
git subtree pull --prefix=resources/standalone/PolyZone polyzone master --squash
mv resources/standalone resources/[standalone]
Explanation
Git Add vs. Git Pull: Git's handling of paths can differ between commands. Adding a subtree might succeed with special characters because the command doesn't involve as complex a merge operation as pulling.
Brackets ([ ]) in Paths: Brackets are used by the shell for pattern matching (globbing). If they are not escaped properly or quoted, they can cause unexpected behavior. Quoting or escaping the brackets helps Git and the shell interpret them as literal characters.
If these methods don't resolve the issue, consider checking your Git version or reporting the problem to the Git community, as handling paths with special characters can sometimes reveal bugs or inconsistencies.