Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7491605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:05:10+00:00 2026-05-29T16:05:10+00:00

The scenario I have access to this old linux server, that no longer receives

  • 0

The scenario

  • I have access to this old linux server, that no longer receives any type of updates. Only break and fix. There’s no git installed on the server so I installed it locally on my user at ~/opt/bin. I added the directory to my path and for development on the server I can do pretty much everything I need to do with git.
  • I decided it would be cool to do my development on my workstation instead, and push to production code that is ready.
  • I set up a bare repository at my server, created a post-receive file with a checkout -f to my GIT_WORK_TREE and seems like everything is setup accordingly.

The problem

When I try to push my master branch, I get the following error:

 sh: git-receive-pack: command not found
 fatal: The remote end hung up unexpectedly

I know why this is happening. The $PATH on my SSH is only seeing /usr/bin:/bin:/usr/sbin:/sbin

My user is setup with a /bin/sh shell so using .profile/.bashrc/.bashprofile is not an option.

I can’t use .ssh/environment either, because my PermitUserEnvironment is set to no.

I tried to create a hooks/pre-receive and set the path there, that did not work either.

Any idea on how to make SSH see git and get this working?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:05:11+00:00Added an answer on May 29, 2026 at 4:05 pm

    I found it!

    http://www.wiredrevolution.com/git/fix-git-upload-pack-and-git-receive-pack-errors-on-shared-hosting

    The second solution involves adding the path to your git-upload-path
    and git-recieve-path in your local .git/config file under [remote
    “origin”]. This is the easiest method as you only have to make this
    change once.

    [remote "origin"]
    url = <repo address>
    fetch = +refs/heads/*:refs/remotes/origin/*
    uploadpack = <path to git-upload-pack>
    receivepack = <path to git-receive-pack>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: I have a console application that needs to access a network share with
I have the following scenario. The client code only has access to FooHandler, not
Imagine this scenario: you have a WCF web service that gets hit up to
I have a scenario where a user will have access to a one-time-url. When
We have a scenario where some .NET code is attempting to access the current
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario: I have a text file that has pipe (as in the | character)
Scenario: I have a document I created using LaTeX (my resume in this case),
When debugging a VB6 application, I have noticed that the VB6 IDE keeps any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.