I have run into a common dilemma.
Many times, our company relies on using open source libraries to get things done, but occasionally we have to modify them to get it to run on different platforms, fix bugs, etc.
We use a combination of subversion: TortoiseSVN, and AnkhSVN.
Is there a way for the following scenario to work with SVN:
- Devs adds the source code from an open source project to our subversion (usually via export, depending on what source control they use)
- Devs make several changes to the open source cod开发者_高级运维e
- Open source project creator makes several improvements and bug fixes of their own
- How do we merge the changes from the open source project to our subversion?
If SVN can't do this, is there a better source control option for us? We would prefer one with Visual Studio integration if possible.
Subversion can do this of course. This kind of stuff was happening before distributed VCSs existed. See Vendor Branches section from Chapter 4. Branching and Merging in Subversion book.
Quote:
Managing vendor branches generally works like this: first, you create a top-level directory (such as /vendor) to hold the vendor branches. Then you import the third-party code into a subdirectory of that top-level directory. You then copy that subdirectory into your main development branch (e.g., /trunk) at the appropriate location. You always make your local changes in the main development branch. With each new release of the code you are tracking, you bring it into the vendor branch and merge the changes into /trunk, resolving whatever conflicts occur between your local changes and the upstream changes.
Subversion is not the right tool here. What you are looking for requires a Distributed Version Control System, which basically means you can pull and push across repositories, and there's no central repository.
Check out Git and Mercurial for more information. If the upstream project uses Subversion, you can use git-svn as a bridge - you create your own repository, change stuff, and you can still merge the svn into it as well as push to your own "upstream/central" git repository.
Also note: Is there a reason you don't contribute your changes directly to the project? (Especially if the project is licensed under something like GPL or LPGL that forces you to release your modified source to the public under a suitable license, which many projects are). It seems that would be a great way to give back to the people that are giving you code for free...
The following question addresses Git + Visual Studio: Using Git with Visual Studio
精彩评论