0

Looking for an equivalent svn command to the selective adding and committing in git:

git add --patch

0x90
  • 39,472
  • 36
  • 165
  • 245
  • 2
    Subversion doesn't have an equivalent to Git's index, and as far as I know completely lacks the concept of a partial commit. Aside from manually moving some changes out of your working directory, committing, and moving them back in, I'm not sure that you've got many options. – ChrisGPT was on strike Sep 03 '14 at 12:13
  • 2
    I closed my question, yet leave it here for future google searches, when someone will look for `git add --patch svn` it will come up. – 0x90 Sep 03 '14 at 14:02
  • In linux: `patch -p0 < file.patch `, in windows you may use Tortoise. – 0x90 Jun 28 '15 at 20:14
  • 1
    the `patch` command doesn't do the same this as `git add --patch`. – ChrisGPT was on strike Jun 30 '15 at 02:32
  • @Chris not the same but similar... – 0x90 Jun 30 '15 at 09:27
  • 1
    They're not even close. [`patch`](http://linux.die.net/man/1/patch) applies an arbitrary patch file to an arbitrary set of files. It changes files on disk, and has nothing to do with version control. [`git add --patch`](http://git-scm.com/docs/git-add) lets you interactively stage modified hunks in preparation for committing. It doesn't involve a patch file, doesn't modify the files that are being operated on, and it only makes sense in the context of Git. – ChrisGPT was on strike Jun 30 '15 at 11:34
  • @Chris for some cases it is exact the same behavior for others it is similar and for some pathological cases it is totally different, that's why it is similar. Let's agree on that. – 0x90 Jun 30 '15 at 11:39
  • 1
    I'm not aware of a single case where it is remotely similar. Can you give an example? – ChrisGPT was on strike Jun 30 '15 at 11:40
  • http://stackoverflow.com/questions/3418277/how-to-apply-git-diff-patch-without-git-installed – 0x90 Jun 30 '15 at 11:44
  • 1
    That question has to do with applying a patch file created by `git diff` without having Git installed. In that case `patch` is being used as a replacement for *[`git apply`](http://git-scm.com/docs/git-apply)*, not [`git add`](http://git-scm.com/docs/git-add). Nowhere in that question is `git add` mentioned. – ChrisGPT was on strike Jun 30 '15 at 11:51

0 Answers0