[SOLVED] Git problem

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Locked
rikiko
Starting out
Posts: 23
Joined: Tue Jun 18, 2013 7:33 pm

[SOLVED] Git problem

Post by rikiko »

I'd like to share a solution I found:

To use git on QNAP I had to configure uploadpack and receivepack as described at http://stackoverflow.com/a/6495787

Code: Select all

git config remote.origin.uploadpack /path/to/git-upload-pack
git config remote.origin.receivepack /path/to/git-receive-pack
Rikiko
rikiko
Starting out
Posts: 23
Joined: Tue Jun 18, 2013 7:33 pm

Re: [SOLVED] Git problem

Post by rikiko »

Hi,
In another PC I was trying to clone a project and the command "git clone" give me an error:
sh: git-upload-pack: command not found

This was because in ssh I can "see" the $PATH and I can't see the command
infact

Code: Select all

$ssh -p 1111 admin@myNASIP git-upload-pack
sh: git-upload-pack: command not found
but

Code: Select all

$ssh -p 1111 admin@myNASIP /opt/bin/git-upload-pack
usage: git upload-pack [--strict] [--timeout=<n>] <dir>
so I created a simbolik link in /usr/bin :
/usr/bin$ ln -s /opt/bin/git-upload-pack


(also for /usr/bin$ ln -s /opt/bin/git-receive-pack )


Now git clone works!

I hope this post will be userfull to other user.
Rikiko
thinlizzy
First post
Posts: 1
Joined: Wed Jul 29, 2015 1:40 pm

Re: [SOLVED] Git problem

Post by thinlizzy »

Thanks rikkio - your message solved my problem which occurred after upgrading from git 1.8 to 2.1. All I did to resolve this issue was:
  • * shh as admim
    * do this:

    Code: Select all

    cd /usr/bin
    ln -s /MD0_DATA/.qpkg/git/repository/bin/git-upload-pack
    ln -s /MD0_DATA/.qpkg/git/repository/bin/git-receive-pack
    
Note to anyone else wanting to try this: on my QNAP TS-212 I created a hidden shared folder git so the /MD0_DATA/.qpkg/git part will likely be different on your system.

Thanks again!
ToJoh
New here
Posts: 3
Joined: Thu Feb 05, 2015 1:09 am

Re: [SOLVED] Git problem

Post by ToJoh »

Thanks @rikiko & @thinlizzy!

As I could not recall, where I installed git using IPKG, but also installed GIT in the App Center, the following worked for me:

Code: Select all

 cd /usr/bin
 ln -s /Apps/git/bin/git-upload-pack
 ln -s /Apps/git/bin/git-receive-pack
I am just wondering: Is it also advisable to create a symbolic link for the folder "git-shell"?
rflsouza
Starting out
Posts: 16
Joined: Fri Oct 07, 2011 9:47 am

Re: [SOLVED] Git problem

Post by rflsouza »

Thank you guys! I updated the git the App and had the same problem. Show message :
git-upload-pack: command not found
fatal: The remote end hung up unexpectedly


But, I resolved with the solution of you. Now everything is normal.
TS-253Be - 16GB memory - Crucial 16GB DDR3L-1600
2 - HD Seagate IronWolf NAS, 8TB, 3.5´, SATA - ST8000VN0022 (RAID 1)
2TB Seagate ST2000DL003-9VT166 (SATA) External backup (usb)
----------------------------------------------------
TS-251+ I used for 5 years (dead intel)
TS-219P+ Turbo NAS(old) working more than 10 yeas
3TB Seagate ST3000DM001-1ER166 (SATA) (dead)
anon4life
First post
Posts: 1
Joined: Tue Apr 21, 2015 12:07 pm

Re: [SOLVED] Git problem

Post by anon4life »

#!/bin/bash
echo After installing entware, install this file:
echo in path /opt/etc/init.d/S01_myinit.sh
echo "writing timestamp: + parameter: $1 to less /share/MD0_DATA/entware_init.bootlog"
echo QNAP TS-421 $1 : $(date +"%Y-%m-%d_%Z-%H-%mm-%ss") >> /share/MD0_DATA/entware_init.bootlog 2>&1
echo ensuring that git works via ssh >> /share/MD0_DATA/entware_init.bootlog 2>&1
ln -s /opt/bin/git-receive-pack /usr/bin/ >> /share/MD0_DATA/entware_init.bootlog 2>&1
ln -s /opt/bin/git-upload-pack /usr/bin/ >> /share/MD0_DATA/entware_init.bootlog 2>&1
Locked

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”