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 8972073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:07:28+00:00 2026-06-15T18:07:28+00:00

I use ssh to access a remote git repository. I add such a simple

  • 0

I use ssh to access a remote git repository. I add such a simple post-receive script in hooks directory:

#/bin/sh
REPO="$1"
REV="$2"
echo $REPO $REV >> /var/log/gitlog

I changed the code in local PC and push many times, and I saw nothing in /var/log/gitlog. I have checked the permission of post-receive. Its file mask has been set to 777. All users can execute the script on the console.

  • 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-06-15T18:07:30+00:00Added an answer on June 15, 2026 at 6:07 pm

    That may be because that hook (post-receive) doesn’t take any argument.

    See gitHooks:

    This hook is invoked by git-receive-pack on the remote repository, which happens when a git push is done on a local repository. It executes on the remote repository once after all the refs have been updated.

    This hook executes once for the receive operation. It takes no arguments, but gets the same information as the pre-receive hook does on its standard input.

    This answer mentions:

    You have to use the read command.

    #!/bin/sh
    read oldrev newrev refname
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access a private remote SSH git repository via the Eclipse 'egit'
I'm trying to use a remote Git repository that only provides access over HTTPS
git clone supports both HTTPS and SSH remote URLs. Which should I use? What
I have a remote web server that I have full access to (ssh, git,
I'm using JGit to access a remote Git repo, and I need to use
I've set up a git repository that I access over a remote connection. Using
My host allows limited access to SSH and Linux commands. However, I can't use
I am trying to use ssh port forwarding to defeat corporate firewall: ssh git@GIT_SERVER
I have a remote server that hosts my subversion repository on a non-standard ssh
I need to create a shell script to do this: ssh to another remote

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.