The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
"if you want to keep them" - it is not exactly what I want. I just try to figure out how to use git with branches without causing any errors.
Let's say I have branch DEV, DEV-UpdatedFiles, DEV-AddedFiles, DEV-DeletedFiles.
Ideally I want following:
-- I want to be able to switch between DEV to DEV-UpdatedFiles or DEV-AddedFiles or DEV-DeletedFiles without exception similar the ones I explained before or at least to understand why it happens. Once it switched I would like to see in the Source Control Pane files that belong to corresponded branch only. For instance, I don't want to see added files from DEV-AddedFiles branch in, let's say, DEV-UpdatedFiles.
-- I want to able to switch between feature branch to DEV and in source control pane to see no files, because I didn't do any updates in DEV.
It is what I want eventually to achieve, which cannot be done with Git as I understood. So, at least I want to be sure, I can switch between DEV to feature branch and back without exception and I don't want to loose files accidently.
So, let me rephrase your suggestion. When next time I will get the same exception when I try to switch between DEV to feature branch I need to run
git add -A
git stash
git pull
if -A is not working I should try next code:
git fetch --all
git reset --hard origin/<branch-name>