By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 post-receive

View raw Download
text/x-shellscript • 431 B
Bourne-Again shell script, ASCII text executable
        
            
1
#!/bin/bash
2
3
while read oldrev newrev refname
4
do
5
# Check if the refname starts with "refs/heads/"
6
if [[ $refname == refs/heads/* ]]; then
7
# Extract the branch name from refname
8
branchname="${refname#refs/heads/}"
9
10
# Change to the repository's working tree
11
cd /path/to/your/repo/working/tree
12
13
# Update the working tree for the branch
14
git checkout -f "$branchname"
15
fi
16
done
17