Skip to content

Instantly share code, notes, and snippets.

@eugenius1
Last active November 2, 2016 02:46
Show Gist options
  • Save eugenius1/b16e8bf5b189787a5f81adf2d023a33a to your computer and use it in GitHub Desktop.
Save eugenius1/b16e8bf5b189787a5f81adf2d023a33a to your computer and use it in GitHub Desktop.
Imperial EEE HPCE coursework - new git repo folder
#!/bin/bash
# 1. Store this in your HPCE folder, i.e ~/Documents/EEE/4/HPCE
# 2. Fill in your Imperial login below, no spaces
# 3. Invoke with `bash ./new-cw.sh 1` (without quotes and where 1 is the new coursework number)
ic_login=xyz89
if [ ! "$1" ]
then
echo "You forgot the coursework number. Goodbye"
exit
fi
year=$(date '+%Y') &&
echo " Year is ${year}" &&
cw_num=$1 &&
git clone "https://github.com/HPCE/hpce-${year}-cw${cw_num}.git" hpce-${year}-cw${cw_num}-${ic_login};
cd ./hpce-${year}-cw${cw_num}-${ic_login} &&
git remote -v &&
git remote add private "https://github.com/HPCE/hpce-${year}-cw${cw_num}-${ic_login}.git" &&
git push -u private master;
git remote -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment