mirror of
https://github.com/nextcloud/documentation.git
synced 2025-07-21 23:46:31 +00:00
22 lines
536 B
Bash
Executable File
22 lines
536 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Clone Nextcloud server repo into $CWD/server
|
|
# if it already exists the latest commits from
|
|
# the specified branch will be fetched
|
|
|
|
NC_BRANCH="${1:-master}"
|
|
|
|
printf "\n\n"
|
|
echo Fetching source for $NC_BRANCH
|
|
printf "\n"
|
|
|
|
if [ -d server/.git ]; then
|
|
cd server
|
|
git remote set-branches --add origin $NC_BRANCH
|
|
git fetch --depth 1
|
|
git checkout $NC_BRANCH
|
|
git reset --hard origin/$NC_BRANCH
|
|
else
|
|
git clone https://github.com/nextcloud/server server --depth 1 --single-branch --branch $NC_BRANCH
|
|
fi;
|