Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with a Locally Hosted Git #14

Open
joseph-devito opened this issue Apr 25, 2015 · 9 comments
Open

Working with a Locally Hosted Git #14

joseph-devito opened this issue Apr 25, 2015 · 9 comments

Comments

@joseph-devito
Copy link

Would this work with a git repo that is hosted locally? I have this working on a server that I own but I recently started a new project that I'm working on only locally, any chance this could work that way ?

@ofek-a
Copy link

ofek-a commented Jul 18, 2015

I need this as well, any help?

@abhisheksagi
Copy link

Hey guys yes it should work with locally hosted git as well

@abhisheksagi
Copy link

you just need to add it to your post commit hook in locally created git repository

@Brendonwbrown
Copy link

Exactly. Post-recieve hooks run after a remote gets updates. Post-commit runs after each commit. For some reason, however, my post-commit is not working.

@jovandeginste
Copy link
Contributor

@Brendonwbrown is the hook not executing, or is the script not behaving as expected?

@ivomarino
Copy link

I'm also interested in this. I've put the whole code in post-commit but it does not seem to start.
It neither gets inside the while on line 311:

while read line; do
  set -- $line
  notify $*
  RET=$?
done

there seems no line to be read. If I add an echo test at the beginning of the script I can see it so I know post-commit is executed. Any suggestions? Thanks.

@jovandeginste
Copy link
Contributor

I think you will need to write a wrapper script to be called from either 'commit-msg' or 'post-commit' - see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

@ivomarino
Copy link

Yes, seems so. At this point the question is what we need to pass over to the original script, as arguments, in order to start the while loop? Thanks for feedback.

@jovandeginste
Copy link
Contributor

According to some other hooks: oldrev newrev refname

oldrev will be previous commit, newrev latest commit and refname will be
something like refs/heads/master

Met vriendelijke groet,
Jo Vandeginste

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants