Switching from branch to master on git desktop


I would appreciate help with a process question.  I am using Github Desktop for a project and have setup a local repository.

I open in Atom, make changes, then commit changes through git desktop. I have noticed that when I commit changes to a branch with git desktop, then switch to the master of the same repository, the master is showing changes because both the branch and master branch edits are happening in the same local file. 

When I commit an edit on a branch and then switch to master branch of the same repository the whole page I made an edit on is showing changed. 

If I attempt to commit I get this error: 

error: lstat(“index.html”): Permission denied fatal: Unable to process path index.html

If I attempt to switch back to a branch without commiting I get this error: 

error: Your local changes to the following files would be overwritten by checkout: index.html Please commit your changes or stash them before you switch branches. Aborting

What process is customary for working on both a master and branches that are located on the same local repository (same folder)?

Should I download and replace the “master” files in the local repository every time I want to switch from working on a branch to the master?  


Hi @bhoffco,

When you’re working on a branch, any file changes that you make should not persist when you switch back to master. If they are persisting because you have the file open in Atom, Atom should let you know that the file has changed on disk and ask you if you would like to reload the file. Is that happening?