I have a git repository with 2 branches. My .gitignore specifies “*.dll” as one of the patterns.
- When in
branch1, I copy-pastetest.dllinto the root folder. - Then I switch to branch #2 using
git checkout branch2.
My branch2 shows the newly added test.dll. I don’t want it to show up in branch2. Is it possible to associate this untracked and ignored file with branch1, so that it will only show up when I git checkout branch1?
Thank you.
It doesn’t seem to be easily done, and the solution proposed in “Using git, how do I ignore a file in one branch but have it committed in another branch?” doesn’t work.
You can ignore it temporarily
But that is a local setting (it wouldn’t be propagated by a
pushlike a.gitignorefile would)