david.colais
david.colais

Reputation: 619

GIT Branch Clarification

I have a few files in the master branch which have been committed.

Then I create another branch and switch to that branch as well.

Now in that another branch I modify the files which are also present in the master branch.

But still I have not committed the changes on the other branch.

If I try to switch to the master branch it lets me to switch carrying all changes I have made on the other branch.

GIT should not allow me to switch to master branch until I commit the changes in the other branch right?

Please correct me if I'm wrong.

Upvotes: 0

Views: 37

Answers (1)

ksol
ksol

Reputation: 12265

Git will let you switch accross branches, even if you have uncommited changes. However, it will NOT let you switch to another branch if doing so would result in a conflict.

Upvotes: 2

Related Questions