I'm using git-svn. How can I get a list of what I've committed into git, but haven't yet committed to the SVN repository since the last git svn dcommit
? That is, how can I verify what is about to be sent if I do a dcommit?
You can clone a subversion repository to your machine using git svn clone <SVN repo URL> . The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository which is often useful.
SVN has one central repository – which makes it easier for managers to have more of a top down approach to control, security, permissions, mirrors and dumps. Additionally, many say SVN is easier to use than Git. For example, it is easier to create a new feature.
The biggest difference between Git vs Subversion (SVN) is that Git version control is distributed while SVN is centralized. There are also key differences in repositories, branching, and more. If you're considering switching from SVN to Git, you'll want to take these into account.
The --dry-run
option for git svn dcommit
is very useful for finding out exactly what will be committed to Subversion. In particular that has the properties that:
In general it's a good idea to do git svn rebase
before even thinking about using dcommit
, so that your history is linearized - otherwise merge commits may not make much sense in the Subversion history. (If you've done that, then git log
and gitk --all
will also be essentially equivalent, but I think git svn dcommit --dry-run
gives you a more accurate picture of what's about to happen, even if it's more difficult to interpret.)
The easiest way I think is to do this using gitk. You will want the --all option to see all branches. If you have not used it before simply type:
gitk --all
You will see a graphical view of your branches. When you update from SVN, you essentially do a rebase (git svn rebase). This means any local commits that are not checked in to SVN will appear on the branch after the last SVN commit. Basically look at the commits between your remote SVN trunk and your master branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With