bash: gitolite: command not found - gitolite

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.

This step comes after the Gitolite installation, which supposes you have chosen one of three possibilities:
Keep the sources anywhere and use the full path to run the gitolite command.
Keep the sources anywhere and symlink just the gitolite program to some directory on your $PATH.
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.

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.

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

Related

NVM issue after recovery/reinstall ubuntu

Over the weekend I had to performed a fresh install on Ubuntu on my laptop.
I was restoring my files from my backup, but I used the wrong username.
I've tried to change the username and the $PATH but I'm still getting the same error
t0m#asuntu:~$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
=> Downloading nvm from git to '/home/ubut0m/.nvm'
=> mkdir: cannot create directory ‘/home/ubut0m’: Permission denied
ls: cannot access '/home/ubut0m/.nvm': No such file or directory
fatal: could not create leading directories of '/home/ubut0m/.nvm': Permission denied
Failed to clone nvm repo. Please report this!
t0m#asuntu:~$ vim .bashrc
t0m#asuntu:~$
I've tried removing and reinstalling everthing (NPM, Node, NVM), but don't know why I can't get the script to work. Any help is appreciated.
Check that you're $HOME environment variable matches that of the user you are currently running as, which you can check with whoami. Sometimes, some tools that elevate privileges (such as sudo) preserve the old user's home directory environment variable while running as the new user.
If that's not the problem, check that your home directory exists and has the correct permissions. Usually, if that's the problem, all sorts of other issues pop up (but I can understand a tendency to ignore such things on a newly restored machine).
If it's neither of those things, you can try making sure that you are in your home directory when running the wget | bash command although that really shouldn't be necessary (and if that turns out to be the issue, I would definitely file a bug with nvm about it).

git clone - permissions OK when run from Windows command line but not from Cygwin

If I run a 'git clone' from the Windows 10 command line to a Linux remote repo in our office, there seem to be no permission issues; I'm presented with an ssh login prompt to the remote server, my password is accepted, and the clone runs to completion without a problem.
If I run the same 'git clone' from Cygwin, I don't even get the login prompt and the git command fails with:
Permission denied (publickey,password)
The thing is, I think I know why the problem is happening, but not what to do about it.
Image my name is John Smith. My credentials as stored by the remote Linux server are 'john.smith'. My Windows user folder is 'C:\Users\john.smith'. However, when I start a Cygwin session, the prompt is actually 'John.Smith#myhostname'. So because Windows is case-insensitive, the git clone works because the Windows copy of 'known-hosts' can be located (no case issues). However, the copy of 'known-hosts' in Cygwin isn't being located because of the mismatch between the Unix username (john.smith) and the Cygwin username (John.Smith). That's my theory anyway !
What do I need to do in Cygwin to lower-case my username so that everything aligns ?
Thanks
Can you try to issue the clone command with the format: john.smith#linuxhost:path/to/repo?
Check where your git configuration is
git config --list --show-origin
cygwin probably uses /home/john.smith as home/profile folder(directory).
But here is main issue ssh configuration.
You could copy your ssh private and host keys from windows location to cygwin home .ssh directory.
Check in your Cygwin install folder under <install-path>/Cygwin/home/<username>
You should find:
.gitconfig - edit this to change your username and email address etc...
.ssh - this contains your known-hosts and id_rsa ssh keys. You probably need to copy your windows ones into here.
You may also find other issues in Cygwin like auto complete not working? and a few other gotchas...?

Running a script during Debian Packaging

I have some source files and one bash script to run during installation in Ubuntu machines.
What is an easy guide to Debian packaging and create packages for own use?
My practice includes:
I made a sample which copies the files in to /usr/bin/ folder using pbuilder environment, but got struck with running a process.sh file which contains:
set -x
cpath=`pwd`
cd /usr/local/
mkdir libexec
cd
cd $cpath
cp askpin /usr/local/libexec/
cp badpin /usr/local/libexec/
cp msg /usr/local/libexec/
ldconfig
Any help is appreciated.
Traditionally these scripts go into the debian/DEBIAN directory along with the control file and are called preinst, postinst, prerm and postrm.
They are run when it is appropriate by the installation/removal process.
Include a shebang at the top of these files.
See: https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
Edit:
Just chased down pbuilder and realised that the above answer probably means nothing to you.
I didn't know pbuilder existed, if I had maybe I would have used it, instead of scratching my debian builds into the bare metal, where the above answer makes sense.

Autorun Bash Script after Login to Sync Git Repos

I have already a gitupdate.sh that I found on the internet.
My problem now is how to make the script run automatically every time I log into my Ubuntu 14.04 computer.
I have tried adding this line to .bashrc
sh '/path/to/git/repo/gitupdate.sh'
The problem here is the script is executed not in the context or path of the repo thus the script runs in a folder that is not initialized with git. (I don't actually know what folder bashrc run on)
What want to do is that the update script to be run by Ubuntu in the context of the path so the script will not fail. And also show the running script in a Terminal window that will not automatically close.
And the ultimate goal, is to be able automatically upon login, that git cloned repos to be synced with the public repos.
Try
(cd repo && bash /path/to/gitupdate.sh)
Just open the gitupdate.sh and at the beginning of the file just add the command to go to the selected direcotry. For example:
cd /var/test

ThoughtWorks GO Add Pipeline - Failing to find GIT in PATH

"Failed to find 'git' on your PATH. Please ensure 'git' is executable by the Go Server and on the Go Agents where this material will be used."
I'm getting this when attempting to use GIT when creating a new build pipeline.
I'm not that experienced with Linux to know how to debug this and I can't find anything in the docs or via a google search.
GO was installed as root, so was GIT, the server has been rebooted since and I can run git in bash. "which git" shows that it is in /usr/bin. "export $path" shows that /usr/bin is in the PATH variable.
Can anyone recommend anything else to try?
Thanks.
The Go server and agent runs under user 'go' and therefore you will need to ensure git is in path for this user.
Change the user to go. If you get a prompt for password, put the password of the current logged in user.
$ sudo su - go
Then check if git is in path or simply check for the version
$ which git
$ git --version
If you don't get expected output for the above commands you might have to provide git executables to the user 'go', that is, you will need to add git in this user's PATH. Alternatively, you can provide the path in /etc/default/go-server
export PATH=$PATH:/path/to/git
I recall having this problem too, for me it was related to a local git repository that I did not share with the git daemon. Running the repository with the git daemon solved this problem for me.
URL for me starts with git://localhost, not sure if http will work too

Resources