bash: gitolite: command not found

2019-04-10 19:52发布

问题:

I am trying to make a new branch in Gitlab by using Gitolite. I complete the installation steps. when i come across "setting up gitolite" section i have a trouble. I followed this link.

When i run

            gitolite setup -pk alice.pub 

command i got "bash: gitolite: command not found" error message. I don't know what is the problem.. Any one please help me.

回答1:

This step comes after the Gitolite installation, which supposes you have chosen one of three possibilities:

  1. Keep the sources anywhere and use the full path to run the gitolite command.
  2. Keep the sources anywhere and symlink just the gitolite program to some directory on your $PATH.
  3. Copy the sources somewhere and use that path to run the gitolite command.

So make sure gitolite is in your PATH, and that command will work.

I prefer a local installation of gitolite (in a local directory, as opposed to /usr/local, which requires root privileges.).
See, for illustration, "install_or_update_gitolite.sh"

"${github}/install" -to "${gtl}/bin" # Note: "${gtl}/bin" is in my $PATH
GITOLITE_HTTP_HOME= gitolite setup -pk "${H}/.ssh/gitoliteadm.pub"

Note that for gitolite setup to properly work, you might want to set GITOLITE_HTTP_HOME to an empty string first.



回答2:

As I also faced the same problem, I found the solution(s) as below.

First way is ...,

Open your terminal and key in below code

$ PATH=$PATH:~/bin

It is because the value of $PATH variable is point to incorrected path.
So I just modify this variable.

To be more detail click here.

Second way is ...,

Edit .bashrc file going to the end and insert below line.

PATH=/home/git/bin:$PATH

To be more detail click here.



回答3:

On debian, there is no /usr/bin/gitolite

Linux debian-srv 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux ls: cannot access /home/gitolite/bin: No such file or directory 
ls: cannot access /usr/bin/gito*: No such file or directory

Here installing gitolite3 helped:

apt-get install gitolite3
root@debian-srv:# which gitolite
/usr/bin/gitolite