I am using source tree, and having to branches local and master, when i switch the branch from local to master , and opened the solution using visual studio i found some files were missing , I am not sure what happens to local code when we switch the branches, please help me on this.
When you switch a branch, all files that are under control of Git will be replaced with the state of the new branch. That includes changes to files as well as additions and deletions.
Note that this is a normal Git feature and doesn't have anything to do with Sourcetree (the UI simply executes a git co
command in the background)
In your case this means that you have some files in your current 'local' branch that simply do not exist in the master. You could get them there by merging your 'local' branch into the master branch.
The files are "hidden" by Git and can be revealed by switching back to your branch.
The changes in your code will be stored in your branch and whenever you switch again to the old branch you can get your codes.
In general if you want to switch between branch you just commit and merge it with master always.
Hope your problem sloved
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With