i was working on a branch for some changes on a files called S3Trait.php
, and next they when i checked the branch all my changes were gone
not sure why but luckily my ide has history and i could see files been changed externally (maybe i did a pull from origin or something ).... no problem i reverted the changes back using ide history
but now something odd is happening , when i switch to other branches i can see the reverted files mentioned
$ git checkout dev
Switched to branch 'dev'
M app/Traits/S3Trait.php
Your branch is up to date with 'origin/dev'.
git checkout main
Switched to branch 'main'
M app/Traits/S3Trait.php
Your branch is behind 'origin/main' by 12 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
and when i do a git status
this files shows up on all branches as modified
$ git status
On branch main
Your branch is behind 'origin/main' by 12 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: app/Traits/S3Trait.php
here is dev
$ git status
On branch dev
Your branch is up to date with 'origin/dev'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: app/Traits/S3Trait.php
it's like this file has been modified across all branches ... and if i restore it in one branch i will lose the change in all branches
(dev)
$ git restore app/Traits/S3Trait.php
(dev)
$ git checkout main
Switched to branch 'main'
Your branch is behind 'origin/main' by 12 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
(main)
$ git status
On branch main
Your branch is behind 'origin/main' by 12 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
not sure what's happening !