回购:找不到命令?
我是 git 和 repo 的新手。我使用的是window 7,所以我使用cygwin。我已经从 cygwin 安装程序安装了 git。之后我尝试在 cygwin 中使用以下命令进行存储。
$ repo init-u git://android.git.kernel.org/platform/manifest.git
我收到这样的错误:
bash: repo: command not found
我想我需要为 repo 设置 cygwin。接下来我需要什么才能获得回购协议?
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.
$ 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
情况 1:尚未安装 google repo?
需要时使用以下校验和:
对于版本 1.25,它是
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
对于版本1.26,它是
0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee 969d52363a86b
案例 2:已经安装了 google repo,但仍然想知道出了什么问题?
添加
PATH=~/bin:$PATH
到文件 ~/.bashrc 末尾然后运行
源~/.bashrc
Case 1: Not installed google repo yet?
Use the following checksums when required:
For version 1.25 it is
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
For version 1.26, it is
0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b
Case 2: Already have google repo Installed, still wondering what went wrong ?
Add
PATH=~/bin:$PATH
to the end of file ~/.bashrcand then run
source ~/.bashrc
您仍然需要安装 repo。 repo 是构建在 git 之上的第三方工具。看:
http://source.android.com/source/downloading.html
如何安装
You still need to install repo. repo is a third party tool built on top of git. See:
http://source.android.com/source/downloading.html
for how to install
我有同样的问题,我必须这样做:
$ PATH=~/bin:$PATH
每次我重新同步但至少它有效。I have the same problem and I have to do:
$ PATH=~/bin:$PATH
every time I repo sync but at least it works.添加行
在文件
~/.bashrc
中导出PATH=~/bin:$PATH
add line
export
PATH=~/bin:$PATH
in file~/.bashrc
编辑 .bash_profile 并取消注释这些字段。 (任何文本编辑器都可以)
重新启动 CYGWIN。
edit .bash_profile and uncomment these fields. (any text editor will do)
Restart CYGWIN.
检查并查看您是否同时拥有 .profile 和 .profile 。工作目录中的.bash_profile。
如果这样做,则两者中的导出命令实际上可能在您的 shell 中发生冲突。在 Windows 中使输出看起来像这样...
无论如何,这就是我的 bash shell 发生的情况。这两个文件与 Bash 或 Cygwin 的交互方式不同是正确的,但是如果您有冗余输入,它们将编译在一起......
Check and see if you have both .profile & .bash_profile in the working directory.
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...
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...
这是 Android 构建系统错误的答案
对于 Python 3
如果收到“/usr/bin/env 'python' no such file or directory”错误消息,请使用以下解决方案之一:
如果您的 Ubuntu 20.04.2 LTS 是新安装(相对于升级)的 Linux 版本:
如果使用 Git 版本 2.19 或更高版本,则可以在执行 repo init 时指定 --partial-clone。这利用了 Git 的部分克隆功能,仅在需要时下载 Git 对象,而不是下载所有内容。因为使用部分克隆意味着许多操作必须与服务器通信,所以如果您是开发人员并且使用低延迟网络,请使用以下内容:
您可以参阅以下文档 :
下载源
This answer for android build system error
For Python 3
If you get a "/usr/bin/env 'python' no such file or directory" error message, use one of the following solutions:
If your Ubuntu 20.04.2 LTS is a newly installed (vs. upgraded) Linux version:
f using Git version 2.19 or greater, you can specify --partial-clone when performing repo init. This makes use of Git's partial clone capability to only download Git objects when needed, instead of downloading everything. Because using partial clones means that many operations must communicate with the server, use the following if you're a developer and you're using a network with low latency:
you can see document in
Downloading the Source