如何在 Android Studio 中配置 Git 可执行文件的路径?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25427150/
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-08-20 09:25:26  来源:igfitidea点击:

How can I configure the path to the Git executable in Android Studio?

androidgitandroid-studio

提问by deniz

How do I configure the path to the Git executable in Android Studio?

如何在 Android Studio 中配置 Git 可执行文件的路径?

I am working in Linux.

我在 Linux 工作。

Enter image description here

在此处输入图片说明

回答by buxik

Paste this in a terminal:

将其粘贴到终端中:

whereis git

or if you get 'command not found' you can try

或者如果你得到“找不到命令”,你可以尝试

where git

You get the path to your Git executable.

您将获得 Git 可执行文件的路径。

回答by min2bro

I have done it for Windows 7. Probably you can refer this.

我已经为 Windows 7 做了它。可能你可以参考这个。

  1. Download the GitHub For Windows client and install it.

  2. After the client successfully installed, connect it with your GitHub account. It should be easy; just follow the wizard.

  3. Then you should add the git.exe location to your "path variable": Otherwise, if you don't want to add to environment variables.

  1. 下载 GitHub For Windows 客户端并安装它。

  2. 客户端安装成功后,将其连接到您的 GitHub 帐户。应该很容易;只需按照向导操作即可。

  3. 然后您应该将 git.exe 位置添加到您的“路径变量”:否则,如果您不想添加到环境变量。

You can open Android Studio and go to: menu SettingsVersion ControlGit. In the text box next to "Path to Git Executable" you will see "git.exe". Just give it a full path like so: C:\Users...............\git.exe

您可以打开 Android Studio 并转到:菜单SettingsVersion ControlGit。在“Path to Git Executable”旁边的文本框中,您将看到“git.exe”。只需给它一个完整的路径,如下所示:C:\Users.................\git.exe

回答by Arshak

In Windows, After installingGit, you can get the Git location by opening Command Promptand typing: where git

Windows 中安装Git 后,您可以通过打开命令提示符并键入:where git来获取 Git 位置

The above command will show the location of Git.exe, just copy the location & paste it in Path to Git executable & press Test.

上面的命令将显示 Git.exe 的位置,只需复制该位置并将其粘贴到 Git 可执行文件的路径中并按测试。

回答by jinkal

Click here to download git

点击这里下载git

If you use Ubuntu then write this command $ sudo apt-get install git

如果您使用 Ubuntu,则编写此命令$ sudo apt-get install git

回答by Mundroid

For Windows, install git.exeand give the install directory path 'C:\Users\\AppData\Local'. After installation paste 'C:\Users\\AppData\Local\Git\bin\git.exe' in Path to Git executablein the Android Studio settings.

对于 Windows,安装git.exe并提供安装目录路径“C:\Users\\AppData\Local”。安装后,在 Android Studio 设置中的Git 可执行文件路径中粘贴“C:\Users\\AppData\Local\Git\bin\git.exe” 。

回答by Naren

To find the path of executables in Ubuntu just open the terminal and type $ which git

要在 Ubuntu 中找到可执行文件的路径,只需打开终端并输入 $ which git

Mostly it will be in /usr/bin/git and now you can set this path in android studio

大多数情况下它将在 /usr/bin/git 中,现在您可以在 android studio 中设置此路径

回答by Adnan Ali

on command prompt write "where git" it will give the path of git. copy this path and paste in the android studio. it worked for me.

在命令提示符下写“where git”它会给出 git 的路径。复制此路径并粘贴到 android studio 中。它对我有用。