how to separate files in git branches -


so have 2 branches, master , let's hotfix

so when checkout hotfix branch , create file there , checkout master, still can see file in directory, though it's different branch , wonder if there's way separate files 2 directories, when checkout hotfix branch, file present , when checkout master, file shouldn't there.

the file isn't changed git when change branch unless git knows it.

what forgot add, commit file before came master. when it, file is removed when change branch master, , restored when change again hotfix branch.


Comments