回购:找不到命令?

发布于 2024-09-19 02:39:19 字数 389 浏览 3 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

深府石板幽径 2024-09-26 02:39:19

情况 1:尚未安装 google repo?

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

需要时使用以下校验和:

对于版本 1.25,它是
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220

对于版本1.26,它是0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee 969d52363a86b

案例 2:已经安装了 google repo,但仍然想知道出了什么问题?

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

Case 1: Not installed google repo yet?

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

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 ~/.bashrc
and then run
source ~/.bashrc

年少掌心 2024-09-26 02:39:19

您仍然需要安装 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

萌无敌 2024-09-26 02:39:19

我有同样的问题,我必须这样做:
$ 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.

漆黑的白昼 2024-09-26 02:39:19

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

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

偏闹i 2024-09-26 02:39:19

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

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

重新启动 CYGWIN。

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

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

Restart CYGWIN.

与酒说心事 2024-09-26 02:39:19

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

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

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

无论如何,这就是我的 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...

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...

对你的占有欲 2024-09-26 02:39:19

这是 Android 构建系统错误的答案
对于 Python 3

如果收到“/usr/bin/env 'python' no such file or directory”错误消息,请使用以下解决方案之一:
如果您的 Ubuntu 20.04.2 LTS 是新安装(相对于升级)的 Linux 版本:

sudo ln -s /usr/bin/python3 /usr/bin/python

如果使用 Git 版本 2.19 或更高版本,则可以在执行 repo init 时指定 --partial-clone。这利用了 Git 的部分克隆功能,仅在需要时下载 Git 对象,而不是下载所有内容。因为使用部分克隆意味着许多操作必须与服务器通信,所以如果您是开发人员并且使用低延迟网络,请使用以下内容:

repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M

您可以参阅以下文档 :
下载源

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:

sudo ln -s /usr/bin/python3 /usr/bin/python

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:

repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M

you can see document in
Downloading the Source

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文