bash: gitolite: command not found

旧街凉风 提交于 2020-01-01 16:46:10

问题


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


来源:https://stackoverflow.com/questions/13645190/bash-gitolite-command-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!