Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 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