FIre Panda
FIre Panda

Reputation: 6637

Branch sub-folder from trunk

let suppose, in trunk we have a folder with below hierarchy;

Code
  Server Code
  Client Code
  Helper Apps

So, if a developer just need to do a change to Client Code, is it alright for him to branch only this folder and then merge it back to trunk when done?

Upvotes: 1

Views: 1862

Answers (1)

wemu
wemu

Reputation: 8160

Yes that is possible. In subversion there is one rule: "a folder is folder is a folder". Meaning "trunk" or "branches" or "subfeaturetestspike12" are just folders to subversion. You can do everything with any folder - they don't differ. Even the "tags" is just a folder. Usually you have to do something to prevent commits in here.

So in your case you could only copy (or branch) the client code folder and then merge later. Or create a new folder, copy one file from client code and have a branch of only one file. Subversion makes not much of a difference - since a folder is folder... and so on. A merge is essentially repeating changes from one branch (folder) to another.

Keep in mind that creating a partial branch may be a bit dangerous when merging - as the branch did not fully build the whole thing but only parts of it. There are some practices at Apache for example: https://svn.apache.org/repos/asf/subversion/trunk/doc/user/svn-best-practices.html

Upvotes: 2

Related Questions