What is the equivalent command for git commit --amend
in SVN
? I know this option is not available in SVN but I'm looking for workarounds .

- 5,324
- 1
- 27
- 40
-
You have to revert to the commit you want, do your changes, and commit again. I don't have an svn repo at hand to try the commands. – Augusto Jun 02 '16 at 07:59
-
Possible duplicate of [Retract accidental checkin](http://stackoverflow.com/questions/747713/retract-accidental-checkin) – tripleee Jun 02 '16 at 08:03
-
I don't know what `--amend` does but answers so far suggest it undoes a commit or something similar. If that's the case, in Subversion it's called *obliterate* (and, nope, there's no such feature). – Álvaro González Jun 02 '16 at 08:13
-
http://stackoverflow.com/questions/2184317/change-svn-commit-message-retroactively – Ciro Santilli OurBigBook.com Dec 05 '16 at 15:15
-
Like the name implies, `--amend` allows you to add more changes to the change set you just committed. More generally, in Git, you can modify history in the local repo all you like until you `push` your local commits to an upstream repo. – tripleee Sep 21 '17 at 03:37
1 Answers
There is no robust, sane, well-defined way to change history in SVN. Because commits are sent to the central repo when you make them, the integrity of check-outs by other developers cannot be guaranteed if you make changes in the history after that point.
If you can control the clients completely, there are ugly, dangerous hacks you can use to modify the immutable parts of the repository. For example, exporting the entire database, hacking it, zapping the repo, and reimporting would achieve what you describe, but is error-prone and probably extreme overkill for most situations.
Using git-svn
in front of Subversion is probably the absolutely easiest, safest, most productive way to get a safety net which facilitates this, and other features which exist in Git but not in Subversion.

- 175,061
- 34
- 275
- 318
-
1If you are desperate, maybe search for something like "oops, I committed a password which absolutely must not be committed". – tripleee Jun 02 '16 at 08:02