Answer the question
In order to leave comments, you need to log in
How to work with branches in git?
Good afternoon. I worked with one branch until a task appeared that completely changes the entire structure of the application (adding a modular structure), I created a separate branch for this business and started working with it, I did everything, everything is fine - you need to switch to the master branch, switch, work there, then I try to switch to the second branch and suddenly I get an error:
Your local changes to the following files would be overwritten by checkout
Answer the question
In order to leave comments, you need to log in
This error means that you have modified files in your working tree that will be overwritten (that is, the changes will be lost) when you switch to the correct branch. Git keeps you from losing your work.
You either need to commit to commit them and clean up the working tree before checkout, or stash to leave the work for later.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question