简体   繁体   English

如何将IntelliJ与Subversion,Git和“git-svn”一起使用

[英]How do I use IntelliJ with Subversion, Git and “git-svn”

How do I use IntelliJ with Subversion, Git and "git-svn". 如何将IntelliJ与Subversion,Git和“ git-svn”结合使用。

My firm is using subversion for the main repository but I like to use git so I use the command line and issue the following commands 我的公司正在使用subversion作为主存储库,但我喜欢使用git,所以我使用命令行并发出以下命令

git-svn clone -s http://example.com/my_subversion_repo local_dir git-svn clone -s http://example.com/my_subversion_repo local_dir

but at the end I have to issue a git-svn dcommit can this be done from within IntelliJ 但最后我必须发出一个git-svn dcommit,这可以在IntelliJ中完成

git-svn dcommit git-svn dcommit

You can use built-in IntelliJ Git support with SubGit . 您可以使用SubGit内置的IntelliJ Git支持。

There are different options: 有不同的选项:

  1. If you have administrator access to Subversion repository, you can install SubGit 1.0 into this repository and enable Git access to your SVN repository. 如果您具有对Subversion存储库的管理员访问权限,则可以将SubGit 1.0安装到该存储库中,并启用对您的SVN存储库的Git访问。 This way you can work with created Git repository and SubGit will synchronize all the changes with SVN counterpart. 这样您就可以使用创建的Git存储库,SubGit将与SVN对应的所有更改同步。

  2. You can also use SubGit 2.0 (EAP stage at the moment) and synchronize local Git repository with remote SVN repository. 您还可以使用SubGit 2.0(当前为EAP阶段)并将本地Git存储库与远程SVN存储库同步。 So you can keep working with SubGit-enabled local Git repository and all the changes will be replicated to SVN repository. 因此,您可以继续使用启用了SubGit的本地Git存储库,所有更改都将复制到SVN存储库。

For more information please refer to SubGit documentation and to comparison with git-svn . 有关更多信息,请参阅SubGit文档以及与git-svn进行比较

Disclaimer: I'm one of SubGit developers; 免责声明:我是SubGit开发人员之一; SubGit is a commercial software with some free options; SubGit是带有一些免费选项的商业软件。 SubGit 2.0 EAP builds are free to use. SubGit 2.0 EAP内部版本可以免费使用。

我用IntelliJ确认它现在无法完成..

I use PyCharm (which is based on IntelliJ) and I worked around this by setting up a custom command under "External Tools" as follows: 我使用PyCharm(基于IntelliJ),我通过在“外部工具”下设置自定义命令来解决这个问题,如下所示:

Name:        dcommit
Program:     git
Arguments:   svn dcommit
Working Dir: $ProjectFileDir$

You can then dcommit in one of the following ways: 然后,可以通过以下方式之一提交:

  • Select the Tools > External Tools > dcommit menu option 选择Tools > External Tools > dcommit菜单选项
  • Use the Ctrl+Shift+A (Find Action...) popup to execute 'dcommit' 使用Ctrl+Shift+A (查找操作...)弹出窗口执行“ dcommit”
  • Assign a keyboard shortcut in your keymap for even easier execution 在键盘映射中分配键盘快捷键,以便更轻松地执行

It could be a reality in short time: https://github.com/JetBrains/intellij-community/pull/725 它可能在短时间内成为现实: https//github.com/JetBrains/intellij-community/pull/725

Still you need to clone from command line, but after that is merged, other features will be implemented (dcommit, clone, tag) 仍然需要从命令行克隆,但在合并之后,将实现其他功能(dcommit,clone,tag)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM