Let's say i have 2 remote branches, Master and Developer, and that my local repository is on the folder D:/Git_Project.
On git bash i go to the repository directory and select Master branch, i make a folder and a file inside it, commit changes, push it to remote master branch.
Now i switch to the developer branch, and if i now go to D:/Git_Project with windows explorer, i can't see the folders / files from the master branch.
Now, i know that git saves those changes under the .git folder, and loads / saves them whenever we switch branches. But is it possible to have it always show both branches, each with their own folder?
Basically having a "Master" and "Developer" folder under D:/Git_Project .
I know i could "cheat" and make it all in the same branch and create those folders myself, but i would lose the git branch features if i did so.
The reason i would want this is because sometimes when working on some file in the developer, or any other branch, i might want to check a particular file from another branch, and it's quite annoying to always have to switch branch just to open a file locally.
Instead of placing your repo directly under D:/Git_Project, you can clone it under
git worktree add ../develop develop D:/Git_Project/develop
That way, you don't need to clone twice (even shared clones are not needed here)