Author Topic: Process files when switching Git branches  (Read 354 times)

beauharlan

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Process files when switching Git branches
« on: August 21, 2024, 07:04:47 AM »
Hello, When I branched Git from the command line and returned to SlickEdit, I was prompted to reload changed files, including some that had been deleted. Since I know I'll be switching back to the root branch soon, I don't want to save the deleted files (to avoid Git seeing them as new files). I just want to keep them in SlickEdit's cache. When I switch back to the root branch and reload the files in SlickEdit, the previously deleted files are still marked as modified (in red) in the cache list. I have to open each file and Undo to get rid of the "modified" status.

Is there a way to make SlickEdit automatically recognize that these files are identical to the original without me having to manually work on each file? Or is there another method to handle this situation more effectively?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6934
  • Hero Points: 531
Re: Process files when switching Git branches
« Reply #1 on: August 21, 2024, 04:35:04 PM »
There is auto reload code to compare the file on disk to the file in memory. However, this logic doesn't occur if the file indicates it's already modified. Not sure if this can be improved.

You could try using worktrees. Switching within the same tree definitely causes issues.

     git worktree add /some/new/tree/path some-branch-or-tag