Swithing the Branch but Bringing the Previous modifications together

已回答

Hi, guys!

I am new to CLion, and also git. Currently, I am learning using git for management of code versions.

My question is that I added some code in a branch named "new"; and then I wanted to review my code in "master" branch, but after using Checkout in CLion to switch to "master" branch, I found that the added code also show up in the "new" branch.

So, if I want to switch to the "master" branch, and get its status and context as the last time I visited, instead of bringing the modifications done in other branch, is there a way to do it?

Your answer and guide will be appreciated!

0

It sounds like these changes are non-conflicting ones and therefore git allows you to transfer these changes to a different branch.
If you try to run `git checkout` via command-line you will get the same results.
If there are such changes, you can go to Commit tab and then right click on changes => Shelf changes

0

请先登录再写评论。