How to change repositories location in gitolite3 - gitolite

I've just installed gitolite3 and as a default it creates its "home" /var/lib/gitolite3
I want that folder to be somewhere else like /home/gitolite3.
How do I move it there?
All the references I found around the web turn around a REPO_BASE variable that is nowhere to be found.
Any ideas?

GL_REPO_BASE is a variable you can set in your ~/.gitolite.rc file.
By default, it references $HOME/repositories.
But this isn't related to where you have installed gitolite.
You can install it wherever you want:
git clone git://github.com/sitaramc/gitolite
gitolite/install -ln /path/to/wherever/you/want
gitolite setup -pk yourname.pub
The OP added in the comments below:
I added this line to the .rc :
GL_REPO_BASE => "/home/gitolite",
(mind the trailing ',')

Use this command line to reconfigure Gitolite3:
dpkg-reconfigure gitolite3
In the second question the system ask you for repository place. There you cant set any location where you want to have gitolite3 repositories files.

Related

How do I fix $GOPATH/go.mod exists but should not - Linux Fedora

I am new to Golang, I am following this tutorial https://golang.org/doc/tutorial/getting-started but for some reason I keep getting this message every time I try to run the code:
$GOPATH/go.mod exists but should not
I have tried to look at answers like this one: https://stackoverflow.com/a/62062562/9785222 but I dont understand what is GOPATH and where is it.
I am using Vi as an editor on Linux Fedora
GOPATH defaults to $HOME/go on Unix.
Remove the file $HOME/go/go.mod or explicitly set $GOPATH to a different directory.
$GOPATH should point out to the src directory, in my case in Debian, I set $GOPATH to /usr/local/go/src and the problem was solved.
export $GOPATH=/usr/local/go/src
What is GOPATH ?
GOPATH is a variable that defines a folder, under which GO expects our code to reside . For more details, you can check this link

Cloning github repositories to pc and making them executable on linux

Hay guys I have a problem I tried to clone a repo from git by git clone after download I tried to run the command, although the command was not foud. So after adding the file to the path by export PATH = "..." the command did not work how can I fix this?
To specify the location of executables, you must specify the PATH as set of colon ":" separated directories.
Here's a reasonable template for you to follow:
export PATH=$PATH:<add-your-new-dir-here>
Typically, the PATH is always exported, so you'll only need to do this:
PATH=$PATH:<add-your-new-dir-here>
In your question, you indicated that you are adding a "file" to the PATH. Remember, you must add directories.

Where can I find for the location of the repos managed by Gitosis in Linux

We are using Gitosis in our Linux OS server to manage our projects. One time, I mistakenly pushed the config file which contains errors and then I wasn't able to push changes or clone copies of other projects from the server anymore, including gitosis-admin itself. Now, I need to login to the server using the root user and edit the config file there.
So, when I logged on to the server I saw these files:
Then I cd into gitosis-admin:
Then I cd again into gitosis-admin:
Then I vim the config file. This is what I see:
The content is obviously not what I am expecting, because I should have other repos listed in this config file.
I also double checked with git reflog to see the commit history:
Then I thought there might be another gitosis-admin located somewhere else so I search using the command: find / -type d -name 'gitosis-admin'
This is what I got:
The two directories are the ones that I checked. And they do not match the one I have in my local computer.
I tried searching for one of our projects but still I got no result at all.
Then I thought that the root might not have access to the repo files so I switched to the git user by executing the following command:
sudo git
But still, I can't find the directory of the repos.
So now, I need to know where are the repos located so that I might find the "real" gitosis-admin there.
You might be wondering am I checking on the wrong server here. So to prove that I am not mistaken, this is a screenshot of the host address that I am connected to:
This is the remote address of the gitosis-admin git repo shown in source tree:
A typical directory would be the repositories sub-directory of the git user's $HOME directory, that is
~git/repositories
It is possible to change this location using the repositories key of the gitosis section in the configuration file, which typically is a file named .gitosis.conf in the git user's home directory.
To answer the implied question (namely which file to fix to restore gitosis access), that would be ~git/.gitosis.conf as well.
(This is all documented in the gitosis repository's readme file.)

bash: gitolite: command not found

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

Simple command to add directory and all files under into svn

Is there a simple command to add a directory and all files underneath it to svn?
I have tried svn add directory which makes sense to me but this doesn’t work as expected. I have googled it and there are solutions which all appear a bit long-winded for something so simple.
What would be the standard way of doing this?
svn add directory only works if the directory hasn't been added already. Adding all new files is not standard operation in svn world. Git does this but that's sidetracking.
You can often get by with svn add directory/* but it misses new files in existing subdirectory. So:
directory/newDirectory/file -> is added
directory/oldDirectory/file -> is NOT added
If you really need to add any file anywhere in the directory hierarchy this one liner will set-up an alias for you to do this:
alias svn_addall="svn st|grep ^?|sed 's/./svn add/'|sh"
Put it into your .profile and you'll have easy access to it any time. :-)
Funny. Which version of svn are you using. I`m on a mac and use svn 1.6. And it works for me.
When i look at my man pages for svn then it looks like the command is recursive by default. You can permit the behaviour with:
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
svn add folder will add the folder and its contents. How doesn't it work as you expect?

Resources