如何在 Linux Mint 15 (Olivia) 上安装 git-svn

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17553880/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:44:56  来源:igfitidea点击:

How to install git-svn on Linux Mint 15 (Olivia)

gitsvngit-svnlinux-mint

提问by DrewShirts

I am required to interface with SVN at work, but prefer to run Git locally to allow me to have multiple local branches open at any given time. After making the switch from Windows 7 to Linux Mint 15 (Olivia) Cinnamon, I'm finding that git-svn doesn't appear to be available for this release of Linux Mint.

我需要在工作中与 SVN 交互,但更喜欢在本地运行 Git,以便在任何给定时间打开多个本地分支。从 Windows 7 切换到 Linux Mint 15 (Olivia) Cinnamon 后,我发现 git-svn 似乎不适用于此版本的 Linux Mint。

So far, I've tried installing it from http://community.linuxmint.com/software/view/git-svn, but the install returns an error message:

到目前为止,我已经尝试从http://community.linuxmint.com/software/view/git-svn安装它,但安装返回一条错误消息:

    Package 'git-svn' is virtual

I can find no solution for this error.

我找不到此错误的解决方案。

I've also attempted to install it directly in a terminal window:

我还尝试将它直接安装在终端窗口中:

    sudo apt-get install git

While I successfully installed Git, it is not current (1.8.1.2 vs. 1.8.3.2) and this implementation of Git doesn't appear to have a "git svn" command, but does have a "git clone" command. This "git clone" command doesn't appear to have any ability to talk with SVN.

虽然我成功安装了 Git,但它不是最新的(1.8.1.2 与 1.8.3.2),而且这个 Git 实现似乎没有“git svn”命令,但确实有“git clone”命令。这个“git clone”命令似乎没有任何与 SVN 对话的能力。

I have tried using the following:

我尝试使用以下方法:

    sudo git clone https://<username>@<domain>/svn/<projectname>/trunk <folder_to_checkout_to>

After providing the SVN server password, it attempts to clone the SVN repository, but returns with the following error:

提供 SVN 服务器密码后,它尝试克隆 SVN 存储库,但返回以下错误:

   fatal: hhttps://<username>@<domain>/svn/<projectname>/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?

I don't know what this means. In searching on Google and StackOverflow, I've found that the SVN path may be bad or not exist, but I've verified the path is valid as I can access the same path by placing it in a browser and signing in.

我不知道这是什么意思。在 Google 和 StackOverflow 上搜索时,我发现 SVN 路径可能不正确或不存在,但我已验证该路径是有效的,因为我可以通过将其放入浏览器并登录来访问相同的路径。

I thought this error might be caused by the folder_to_checkout_to not existing yet, but when I create the folder and call a "git init" and then re-execute the git clone command above from the parent directory, it returns:

我认为此错误可能是由 folder_to_checkout_to 尚不存在引起的,但是当我创建文件夹并调用“git init”然后从父目录重新执行上面的 git clone 命令时,它返回:

    fatal: destination path '<folder_to_checkout_to>' already exists and is not an empty directory

Using Mysysgit in Windows, the syntax that worked to clone and checkout an SVN repository using Git was as follows:

在 Windows 中使用 Mysysgit,使用 Git 克隆和检出 SVN 存储库的语法如下:

   git svn clone <path_to_repository> -T trunk <folder_to_checkout_to>/

With my install of Git on Linux Mint, it doesn't have the command "git svn" at all. Any help will be appreciated.

我在 Linux Mint 上安装了 Git,它根本没有命令“git svn”。任何帮助将不胜感激。

How do I get git-svn installed?

如何安装 git-svn?

回答by Joel Hernandez

Billy:

比利:

You can check this documentation:

您可以查看此文档:

If this doesn't works, try this method instead:

如果这不起作用,请尝试使用此方法:

$which git
$sudo apt-get install git-core
$which git
/usr/bin/git
$git --version

回答by Eric Wang

Git is installed by default on mint 16 mate. use "git --version" to check.

Git 默认安装在 mint 16 mate 上。使用“git --version”来检查。