Creating a local SVN branch

后端 未结 2 1179
野的像风
野的像风 2021-02-07 09:06

I am working on an SVN repository and do not want to create a new SVN branch. Instead of that, I want to create a branch local to my machine, something which could be done easil

相关标签:
2条回答
  • 2021-02-07 09:39

    Subversion is a centralized version control system. Some of the advantages of a centralized system is that it forces everyone to play with the same codebase. You can't hide your work for months at a time, then suddenly plop it down two days before a major release. The bad part is that you can't truly have a private branch and not have it show up in the repository.

    There's no reason why you shouldn't be able to create your own branch. In fact, I use to give our developers a special "private" directory where they could put their own code, and do private branching. I had a pre-commit script that only allowed the owner of the branch to make changes, although I had it setup, so anyone could see it.

    If you're worried that your private branches might clog up the branches directory, remember you can remove a branch from the branches directory when you're done. Or, you can request a parallel private directory where you can put your stuff.

    If you really want to create a true private area where you can use Subversion and check in code without it appearing in the main repository, you have two choices I know of:

    • SVK: This is a front end distributed version control system that uses Subversion on its backend. You can create your own Subversion repository, and post changes back and forth between your local repository and the master repository.

    • Git: Git comes with a tool called git-svn which allows you to pull data off of a Subversion repository into a local Git repository. You can then use your local Git repository to do your branching, and later push your changed back into Subversion. There's even a Git version of Tortoise.

    The only caveat is that you will have to get your hands dirty with the command line interface with both of these tools.

    0 讨论(0)
  • 2021-02-07 09:55

    I'm afraid you will have to create a new branch and keep merging any changes into it. The only alternative is to simply checkout the branch, keep updating and don't commit (or keep switching prior to commits) until you are finished. You could always have two working copies if you need to work on the original branch/trunk. Nowhere near ideal, but that's the way SVN works, which is still very good given the alternatives at the time.

    I personally manage local history if that is what you are after via my IDE (Eclipse).

    0 讨论(0)
提交回复
热议问题