Skip to main content
summaryrefslogtreecommitdiffstats
blob: 3a31189dec6e2865b09b2234fbffea3eef13d6f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#

REPOSITORIES_TXT="$1"; shift
name="$1"; shift

VAL=$( grep "^${name}:" "$REPOSITORIES_TXT" | cut -f2 -d" ")
if [ -z "$VAL" ]; then
	echo No tag or branch specified for $name
	exit
fi

git fetch

if [ -z "$(git tag -l $VAL)" ]; then
	echo Updating branch $VAL
	git checkout $VAL
	git pull
else
	echo Updating to tag $VAL
	git checkout $VAL
fi

Back to the top