Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SVN have an equivalent to git's commit (without the push)?

Basically I want to stage my changes without pushing them and without switching branches. This allows me to do some work, commit it when I am at a good stopping point, and then continue work in the same branch. If I mess up, I can revert, if I add new changes, I can just commit again.

I realize I can create a feature branch in SVN to track these changes, but again, I'd like to do so while staying in the same branch/trunk. Even the equivalent of git stash would suffice, although it seems SVN doesn't have that feature.

like image 944
Igor Avatar asked Dec 27 '11 21:12

Igor


People also ask

Does SVN commit also push?

Correct, svn commit will push your local modifications to the server.

Can you commit without push?

So commiting changes without pushing allow the save-load behaviour done locally during development. Once you are happy with your work, you then commit AND push.

How do I commit changes in SVN?

Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.


2 Answers

The very point of distributed version control is this feature of local commits that can at a later point be merged with the upstream repository. SVN is not distributed and cannot do it. The central hindrance is SVN's linear revision numbering, which implies that every client must get a new identifying revision number for each changeset. Since "allocating" a revision number and later using it would lead to all kinds of race conditions, the "commit" and "push" actions are atomic in SVN and every non-distributed version control system.

That being said, git's SVN frontend is a good choice, like Joe suggested. It makes sure that SVN never sees your local, individual commits, and the "push" is translated into a single, big SVN commit.

like image 73
thiton Avatar answered Oct 08 '22 23:10

thiton


By design SVN does not, however you can use git's git svn command as a front-end to SVN. It allows you to do push/pull work from an SVN remote but still uses git locally, and thus to make local commits without pushing to SVN repository.

Something like this might help: http://www.viget.com/extend/effectively-using-git-with-subversion/

like image 45
Joe Avatar answered Oct 08 '22 23:10

Joe