Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion: possible to pick which files you can stage for commit?

I'm working on a project that is being versioned with svn. Normally with git, I would pick which files I'd like to make as part of a commit with git add, and then make a commit. The problem is, I don't know if there is a similar way to do something like that in subversion. I end up working on a feature, then get interrupted to fix a bug.. and end up having to commit both of them at once. Is there a smarter way to handle staging of commits so my bug fix and feature can be separate commits in svn? I don't want to branch either, because that's god awful in subversion.

like image 848
randombits Avatar asked Jul 29 '10 17:07

randombits


People also ask

How do I commit multiple files in svn?

Use a changeset. You can add as many files as you like to the changeset, all at once, or over several commands; and then commit them all in one go. svnbook.red-bean.com/en/1.6/svn.advanced.changelists.html -- The svn keyword is "changelist", which is addressed in the first answer and most upvoted.

Does svn have a staging area?

But in SVN, apparently, there is no such staging state.

What is difference between commit and update in svn?

Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.


1 Answers

Two options:

  • Manually choose to only commit the files that you're interested in. svn commit file1 file2 ..., or use a client like TortoiseSVN that provides a GUI for doing so.
  • Use changelists.

(Really, in recent versions of Subversion and with a good client like Tortoise, I don't think branching is as awful as it's made out to be, but that's another story...)

like image 186
Josh Kelley Avatar answered Oct 11 '22 18:10

Josh Kelley