0

I am trying to branch off my React app so I can practise converting files to TypeScript, however when I go to a new branch (typescriptConvert) and change index.jsx to index.tsx, I then check back on my main branch and the file extension has also been changed there too, to .tsx.

I have tried closing and re-opening the file, and resetting VS code as well as 'git clean -xfd' and then re-initialising all the npm packages but still seem to get this issue.

This is the main branch where the extension is still changed to .tsx: this is the main branch where the extension is still changed to .tsx

  • You need to _commit_ the changes to that branch, otherwise they're just in the worktree not actually associated with a specific branch. – jonrsharpe Mar 13 '23 at 16:32
  • This is a frequent question (I'll try to find the dupe in a second), but basically: uncommited changes do not belong to any one branch, but will be kept around when you switch branches. So either *commit them* on the TS branch or *stash them* before switching. – Joachim Sauer Mar 13 '23 at 16:33

0 Answers0