Home » Android » android – repo: command not found?

android – repo: command not found?

Posted by: admin June 15, 2020 Leave a comment

Questions:

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?

How to&Answers:

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

Answer:

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

Answer:

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.

Answer:

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

Answer:

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

Answer:

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…