Android 回购:找不到命令?

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

repo: command not found?

androidgitrepo

提问by aemon

I am new to git and repo. I am in window 7 so I use cygwin. I have installed git from cygwin setup. After that I try to repo with the following command in cygwin.

我是 git 和 repo 的新手。我在窗口 7 中,所以我使用 cygwin。我已经从 cygwin 安装程序安装了 git。之后,我尝试在 cygwin 中使用以下命令进行 repo。

$ repo init-u git://android.git.kernel.org/platform/manifest.git 

I get an error like these:

我收到这样的错误:

bash: repo: command not found

I think I need to setup cygwin for repo. What do I need next to get repo?

我想我需要为 repo 设置 cygwin。接下来我需要什么才能获得回购?

回答by shreddd

You still need to install repo. repo is a third party tool built on top of git. See: http://source.android.com/source/downloading.htmlfor how to install

您仍然需要安装 repo。repo 是建立在 git 之上的第三方工具。有关 如何安装,请参阅:http: //source.android.com/source/downloading.html

回答by logonmanish

add line export PATH=~/bin:$PATH in file ~/.bashrc

在文件 ~/.bashrc 中添加行 export PATH=~/bin:$PATH

回答by MikeInDetroit

edit .bash_profile and uncomment these fields. (any text editor will do)

编辑 .bash_profile 并取消注释这些字段。(任何文本编辑器都可以)

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
#   PATH="${HOME}/bin:${PATH}"
# fi

Restart CYGWIN.

重新启动 CYGWIN。

回答by user1282365

I have the same problem and I have to do: $ PATH=~/bin:$PATHevery time I repo sync but at least it works.

我有同样的问题,我必须这样做: $ PATH=~/bin:$PATH每次我回购同步但至少它有效。

回答by ishandutta2007

Case 1: Not installed google repo yet?

案例 1:还没有安装 google repo?

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Use the following checksums when required:

需要时使用以下校验和:

For version 1.25 it is d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220

对于 1.25 版,它是 d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220

For version 1.26, it is 0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b

对于 1.26 版本,它是 0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b

Case 2: Already have google repo Installed, still wondering what went wrong ?

案例 2:已经安装了 google repo,还想知道哪里出了问题?

Add PATH=~/bin:$PATHto the end of file ~/.bashrc and then run source ~/.bashrc

添加 PATH=~/bin:$PATH到文件 ~/.bashrc 的末尾,然后运行 source ~/.bashrc

回答by Jay Magik

Check and see if you have both .profile & .bash_profile in the working directory.

检查并查看工作目录中是否同时具有 .profile 和 .bash_profile 。

If you do, it's possible that the export command in both is actually conflicting in your shell. Making the output look something like this in Windows...

如果这样做,则两者中的导出命令实际上可能在您的 shell 中发生冲突。在 Windows 中使输出看起来像这样......

PATH="C:/Windows/path/to/repo/Windows/path/to/repo:$PATH"
export PATH

That's what happened to my bash shell anyway. It is correct that the 2 files interact with Bash or Cygwin differently, however if you have redundant inputs, they will compile together...

无论如何,这就是我的 bash shell 发生的情况。这两个文件与 Bash 或 Cygwin 的交互方式不同是正确的,但是如果您有冗余输入,它们将一起编译...