Let say we are working on two features: feature A and feature B. Feature B depends on feature A.
We finished feature A and put it up for a codereview before checking it into trunk. While waiting for feedback from co-workers/collaborators, we want to start working on feature B. So we create another folder or another branch with changes for feature A incorporated.
But when a feedback for the codereview on feature A says that we need to change some code, we have to change both the feature A folder/branch and the feature B folder/branch. This is prone to human errors.
Is there any way for git or svn to make sure that any changes on the folder/branch A will also ported to folder/branch B without checking it into trunk or move the changes manually?
git or svn? is this hypothetical? this question sums up exactly why you’d use git or svn in the first place. yes you can do this. here’s how with git.
I’ll leave it to you to research rebase v. merge workflows with git, but here’s how my team does this…and we do it all the time…(co = checkout)
later, you can always update feature B with feature A’s latest changes
trunk/master is not affected in any way, after your release you can update master with the very latest featureB by checking out master and rebasing off featureB, then pushing the new full-featured master to master. this sort of dev cycle keeps master clean (always ready to deploy) while allowing you dev concurrently on many branches with as many dependencies as necessary. you never have to dupe code changes(if you ever think you do, prolly need to rethink your workflow), but of course you may have to resolve merge conflicts (unavoidable with any divergent code merging).