[GIT][BASH] Update phpBB's fork

https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-white.svg Development 30-May-2019T08:59:41 phpBB Studio https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-white.svg https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-white.svg
note

You need to have Git installed. Site: https://git-scm.com/

tip

Choose to install only the Bash in the options.

Starting

open-bash.png
open-bash.png (5 KiB) Not viewed yet

Create a bash file (script)

  • Write touch up-phpbb-fork to create the file

  • Then write chmod u+x up-phpbb-fork to make it executable

create-file.png

You can now see the new file in the clone’s folder as per this cap.

locate-file.png

File content

#!/bin/bash
#
# Brought to you by phpBB Studio © 2019 ( phpbbstudio.com ) 
#
START_TIME=$SECONDS
echo
echo "Updating master..."
echo
git checkout master
git pull https://github.com/phpbb/phpbb.git master
git push origin master
echo
echo "Done."
echo
echo "Updating 3.3.x..."
echo
git checkout 3.3.x
git pull https://github.com/phpbb/phpbb.git 3.3.x
git push origin 3.3.x
echo
echo "Done."
echo
echo "Updating 3.2.x..."
echo
git checkout 3.2.x
git pull https://github.com/phpbb/phpbb.git 3.2.x
git push origin 3.2.x
echo
echo "Done."
echo
echo "Switching back to master..."
git checkout master
echo
echo "Done."
echo
ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo "Task finished in $ELAPSED_TIME seconds."

Run the file

At this point you can run the script with sh up-phpbb-fork
Your local and forked repos will be automatically updated to latest.

run_script.png

Done.