git svn status-显示未提交给svn的更改 [英] git svn status - showing changes that are not committed to svn
问题描述
我正在git-svn中寻找一条命令,该命令将向我显示已提交给git存储库的更改,但尚未提交给中央svn存储库的更改.我正在寻找类似svn status的功能,但是我正在使用git-svn,不幸的是,git svn status
不是有效的命令.
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.
我尝试了git status
,但是它不能解决此问题,因为它显示了尚未提交给本地git repo的更改.
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.
我也尝试过git svn dcommit --dry-run
,但是它不会告诉我哪些文件准备好提交-它只显示存储库URL.
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.
推荐答案
假定远程Subversion存储库的分支位于remotes/git-svn,请运行以下命令:
Assuming the branch for the remote Subversion repository is at remotes/git-svn, run the following:
git svn fetch
访存将确保remotes/git-svn是最新的. (感谢Mark在评论中指出这一点.)
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
这应该向您显示已提交给git但未提交给Subversion的所有文件的名称和状态,就像svn status
命令一样.
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.
如果您不确定包含Subversion远程存储库的分支位于何处,可以运行:
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
您可能由此推测远程Subversion存储库位于remotes/git-svn中.
You can probably guess from this that the remote Subversion repository is in remotes/git-svn.
这篇关于git svn status-显示未提交给svn的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!