Emre Öztürk
Emre Öztürk

Reputation: 2860

How can i select the comitted files in a post-receive hook in git?

I need to get the file names, which are comitted withhin the post-receive hook.

#!/bin/bash

while read oldrev newrev refname
do
   /* If updated-file == "myFile", then do a specific task */
done

How can i get a reference to the changed files?

Upvotes: 0

Views: 96

Answers (1)

Emre Öztürk
Emre Öztürk

Reputation: 2860

I found a simple solution to get the list of changed files.

git diff --name-only $oldrev $newrev

Upvotes: 1

Related Questions