Reputation: 2681
In SVN (or Git), suppose you are in a working copy directory which has been created by checking out branch A. Now, I need to work and commit to branch B.
In SVN, I can use the svn switch B
and in Git, I can use git checkout B
in order to switch to the branch B.
However, I always have fear of this switching operation; so, I end up creating a new working copy and when I need to work on many branches, I end up with many obsolete working directories.
My question is if the switching the same working copy between different branches is totally safe or not. Do SVN or Git keep any of the files which belong to the other branch, or they really clean up and switch to the new branch?
Upvotes: 0
Views: 319
Reputation: 10319
A switch between branches is the safe operation. I see only one concern: if you have a lot of modified files in your working copy. You may be require to perform a merge or your modified files will be removed. So, if you have a lot of modified files it is better to checkout a new brunch in a new folder.
Upvotes: 2