Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My git master branch seems to have all the files/changes made to a separate branch

Tags:

git

It's possible that I'm not really understanding how git works here, but I have a "master" git branch, and then I created a new branch called "refresh."

I switched to the "refresh" branch, made a ton of changes, file additions, etc, and then switched back to the "master" branch to make some other changes to that branch.

When I did a 'git status' on the master branch, it showed all of the file changes and additions I had made to the 'refresh' branch.

(Note this is all happening on my local dev server...I haven't pushed any of this stuff.)

Shouldn't my master branch have retained all the original files and none of the file additions? Or am I just not understanding how git works?

like image 289
Shpigford Avatar asked May 10 '26 23:05

Shpigford


1 Answers

If you didn't commit the changes to "refresh", they'll be still littering the workplace. Perhaps you forgot to do that before checking out master again?

like image 59
Tordek Avatar answered May 13 '26 14:05

Tordek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!