Standalone git binary on server with repository viewer - linux

I have a server from my company.
On this server is git not installed (and it will not be in the near future).
(On many free server hosting sites, git is also not installed)
Is there a way to use a git binary without having git installed
(therefore without the needed dependencies in another folder, standalone)?
Another server is no option for me.
I want git for a web git repository viewer, which of course need the git binary working in any folder, maybe there is a web git repository viewer with integrated git binary.
I tried:
The server os is linux 64 Bit.
I have copied the git binary from local linux to the executable path on the server.
It did not work.
So I look up the dependencies. These libraries are needed:
libz.so.1
libresolv.so.2
libpthread.so.0
libpcre.so.3
libc.so.6
They are only links to libraries named:
libz.so.1.2.7
libresolv-2.17.so
libpthread-2.17.so
libpcre.so.3.13.1
libc-2.17.so
So I renamed the libraries and copied them to the server where the git binary lies. But unfortunately the git binary looks in the /lib/linux-64-gnu... os folder for the libraries, not in the same folder. I have no idea what to try next.

Here is my solution:
I downloaded and installed Ubuntu 13 on my Windows PC with the same architecture as the server I want to copy the standalone git binary. Architecture is x86_64 which stands for 64 bit. Download link is http://www.ubuntu.com/download/desktop
I burned it to a disk, booted from CD. Then I the username was 'Ubuntu', but I needed another one, so I installed Ubuntu on a USB-Stick 32GB.
I downloaded a git tarball file: 'git-1.7.3.tar.bz2' and extracted it with the command 'tar -jxvf git-1.7.3.tar.bz2' in Terminal after used the command 'cd ~/Downloads' to get to the directory, where the downloaded tarball git file is. Download link is code.google.com/p/kakola/downloads/detail?name=git-1.7.3.5.tar.bz2&can=2&q= (found it with googling 'git .tar.bz2')
Now there is a directory beside the .tar.bz2 file, go into it with 'cd git-1.7.3.5'
Just to make sure I installed every command mentioned from other websites that could be useful with 'sudo apt-get install libexpat1-dev asciidoc libz-dev gettext curl'
I created a directory at the path, where the bin should be on the server, because I only have home access it must be in the home folder, with 'mkdir /home/git'
Then I used the command './configure --prefix=/home/git/BIN CFLAGS="${CFLAGS} -static" NO_OPENSSL=1 NO_CURL=1' to fill the extracted folder with my config file: 'config.mak.autogen'
After that I made 'make' and then 'make doc' to create the files and then 'install' and 'make install-doc' and the directory I wanted the git binary filled up with all these files (pretty big 364MB on the stick)
Downloaded Gitlist and uploaded it to my server and uploaded the whole created Folder with all its binaries into the gitlist folder.
Changed the config.ini from Gitlist to use the standalone binary of git, instead of some PATH (also changed the projects path)
Gitlist finds the repository and shows it in the list view
(With GitWeb I got an error, but GitList seems OK)

Related

replace m2 file on ububtu server 18.04

I install the Apache Maven on Ubuntu server with Apt with sudo apt install maven
I am new to Linux but as I am understanding this installation produces an m2 repository.
what is want is the following:
first how to find and inspect this m2?
second how to replace this m2 with an m2 repository that I have download to my desktop?
By default, maven's local repository is located in the user's home directory. In fact it's actually named ".m2" directory, instead of just "m2". It is a hidden directory. If you are not in your home directory, issue "cd ~" first. Then issue "ls -al" to see the presence of .m2 directory.
If for any reason, you do not see that "m2" directory after issuing above command, it simply means that you did not built or run any project that requires maven to get triggered and create that .m2 folder.
ps: Replacing the existing .m2 folder with the one you have on your desktop may not be a good idea. Instead, simply run the project (that you think requires the needed dependencies). This will build the .m2 directory afresh along with everything that app needs.

Debian packaging and version control

I am building a Debian package from a source tarball. The initial debian directory is created with dh_make.
It creates a directory debian in the directory my tarball was extracted to. I then customize the content of the debian directory to fit my packaging needs. Then I build the package with dpkg-buildpackage -b.
My question is: What is the best (canonical?) way to put the contents of the customized debian directory in version control?
Do I just copy it out of the source directory, keep it in version control somewhere and every time I built, I extract the tarball and copy the directory back?

How to have a Local Install have Precedence Over a System Wide Install?

I have a shell account on a Linux server (running Ubuntu 8.04) with user level permissions (but no root priveleges). The system has Git 1.5.x installed. I wish to run a more current version of git. I can compile from source and install in my home directory but would like the git commands to invoke my local, more current install, rather than the older system wide installation of Git.
How do I go about doing this?
Add the directory containing your git binary to the front of your $PATH. For example, if you installed to ~/bin, add $HOME/bin to the front of your path. You can do that in your shell config file; for bash, add this to .bashrc:
export PATH="${HOME}/bin:$PATH"

What are the files from the 'make' of git that I actually need to run git?

I'm trying to "portablize" git, so I want to send the required executables from the make process of git to my hosted web server. Can I do that? Do you think the executables will work?
The way I do it is to:
get all Git dependencies (as listed in this Solaris package site, but this works for any Unix platform)
compile those dependencies with --prefix=/home/myuser and install them in the usr/local/lib of my home directory
then compile Git (still avoiding any reference to a system path like /usr/local/lib, but only using the lib and include within my homedir)
and install Git in the /home/myuser/git directory
I can then copy only /home/myuser/git and /home/myuser/usr/local (and $prefix/libexec/git-core as Jakub mentions in the comments) to any other similar server, knowing it will work in isolation from any existing system libraries.

Running hg convert on Linux

I would like to convert a remote Perforce repository into a Mercurial repository on Linux.
So I have installed Python and Mercurial on a Linux box.
Then I test few hg (Mercurial's drive program) commands. All are working fine.
Now without creating any hg repository on the Linux box I want to run hg convert on Linux, so that a Mercurial repository (of a Perforce repository) will be created on it.
But when I tried the "hg convert" command it was not working. I know "convert" extension needs to be configured in the .hgrc file. But I don't have any hg repositories here.
Is there any any place on Linux where
I can create hgrc file with convert
extension so that hg convert command will be
accessible for me?
or
Should I first create a hg init
hgrepo on Linux and then edit .hg/hgrc file with
proper configurations and then perform
hg convert //perforce repo/.. /root/hgrepo on hgrepo?
What can I do to resolve this issue?
Place your .hgrc in your home directory, see the manual: hgrc

Resources