git svn status - showing changes that are not committed to svn

人走茶凉 提交于 2019-12-20 10:37:53

问题


I'm looking for a command in git-svn that will show me the changes I have committed to my git repository but that aren't yet committed to the central svn repository. I'm looking for something that works like svn status, but I'm using git-svn, and unfortunately, git svn status is not a valid command.

I tried git status but it does not solve this problem, as it shows changes that haven't been committed to my local git repo.

I also tried git svn dcommit --dry-run, but it doesn't tell me which files are ready to be dcommitted - it only shows the repository URL.


回答1:


Assuming the branch for the remote Subversion repository is at remotes/git-svn, run the following:

git svn fetch

The fetch will ensure that remotes/git-svn is up-to-date. (Thanks to Mark for pointing this out in a comment.)

git diff --name-status remotes/git-svn

This should show you the name and status of all the files that have been committed to git but not to Subversion, just like the svn status command.

In case you're not sure where the branch containing the Subversion remote repository is located, you can run:

git branch -a

which should produce output similar to the following:

* master
  remotes/git-svn

You can probably guess from this that the remote Subversion repository is in remotes/git-svn.




回答2:


You can also use

git diff git-svn HEAD -d

or if you have difftool specified:

git difftool git-svn HEAD -d


来源:https://stackoverflow.com/questions/2426654/git-svn-status-showing-changes-that-are-not-committed-to-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!