Git and GitHub for DS
Note: Changes have been made to this course since the video was recorded. The video is still relevant and will be updated in the future to reflect the changes. For conflicts of the video and the text, the text is the most current.
Setup Git and GitHub
GitHub will be used for publishing all projects
Install git on your computer
Create a GitHub Account with your
BYUI-I email.- Use an appropriate username. It will be the name of your public profile and website in Project 6.
- If you already have a GitHub account, you can add your BYUI-I email to your existing account. Go to
Settings->Emails->Add email addressand make it your primary email.
Install GitHub Desktop
Git a Course Work Portfolio in GitHub
- Use the Portfolio Template in Data Science GitHub repo
- Navigate to the Course Work Portfolio in GitHub
- Click the Green Button
Use this templateand selectCreate a new repository
- Check the box to
Include all branches

- Select
byui-math-deptas theOwnerYou should have been added tobyui-math-deptby your teacher if you dont see it ask them to add you. This Org uses SSO with BYUI, if you dont have your BYUI email in your GitHub account you need to add it (account -> settings -> emails -> add email address) If you have performed all these steps and still dont see it look for a badge aboveRepository templatethat statesSingle sign-on to see results in the byui-math-dept organization.Follow that link to sign in with SSO then you will be able to choosebyui-math-deptas theOwner

- Name the repository as your GitHub
username+_+the current semester and yearall lowercase (see example in image above)
- Select
Privateas the type of Repo, then clickCreate Repository

- Navigate to the Course Work Portfolio in GitHub
- Clone the repository to your computer
- Click the
<> Codemenu - Click the Green Button
<> Codeand selectOpen with GitHub Desktop

- Click the Button
Open in Visual Studio Code
- If it asks for a username and password, this is because your GitHub Desktop is not logged in to your GitHub account via SSO. Log out of your account in GitHub Desktop, be logged in in your browser to GitHub and make sure you can access the byui-math-dept org where you cloned your new portfolio. Then repete these instructions. It will log you back in to GitHub Desktop but this with with the SSO credentials
- Click the
- Use the Portfolio Template in Data Science GitHub repo
If you forgot to
Check the box to Include all branchesin the previous step (otherwise skip to the next step): Create a new branchgh-pages- Create a new branch
gh-pages- Click the
Branch: mainbutton thenview all branches

- Click the
New Branchbutton

- Name the branch
gh-pagesand click the Green ButtonCreate new branch

- Click the
- Modify Pages Settings for Build and deployment from
maintogh-pages:- Click the
Settingstab

- Scroll down to the
Pagessection in the left hand menu

- Locate the Build and deployment section and change Branch from
maintogh-pagesand leave the right side as/root

- Click the
- Create a new branch
Add your teammates as collaborators to your repository
{=html} <iframe id="kaltura_player" src="https://cdnapisec.kaltura.com/p/1157612/sp/115761200/embedIframeJs/uiconf_id/41338032/partner_id/1157612?iframeembed=true&playerId=kaltura_player&entry_id=1_smfzrd38&flashvars[localizationCode]=en&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_law2gmi4" width="608" height="402" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow="autoplay *; fullscreen *; encrypted-media *" sandbox="allow-downloads allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation" frameborder="0" title="Add Your Team to Your Repo"></iframe>Update the
_quarto.ymlfile in course work portfolio:- update the
titleto includ your name - update the
site urlto your published site url (this will be in the deployment section in GitHub) - update the
repo-urlto your GitHub repository url - update the
issue-urlto your GitHub issue url (its the same as the repo url but with/issues/newat the end) - update the
page-footerleftto include your name (line 15) - update the
page-footerrighthrefto include your LinkedIn url (line 18 - optional) - Scroll to the bottom and change the theme
light:and/ordark:to another theme (optional)
- update the
Commit and Push the changes made to GitHub
- Push the changes to GitHub via GitHub Desktop
- Make sure you have the correct repo selected in the top left

- Type a commit message and click the Blue Button
Commit to main

- Click the Blue Button
Push origin

- If it gives you a big long error when you push, this is because your GitHub Desktop is not logged in to your GitHub account via SSO. Log out of your account in GitHub Desktop, and log right back in
- Make sure you have the correct repo selected in the top left
- Confirm the GitHub Actions are working
- Navigate to the repo in GitHub and click on the
Actionstab

- Confirm the
Update _quarto.ymlis working by the yellow circle turning to a green check circle (Note: this can take 3-5min)

- Navigate to the repo in GitHub and click on the
- Push the changes to GitHub via GitHub Desktop
Fix for a common bug
- Fix for the main page loading the ReadMe.md file instead of the portfolio website
- Run
quarto publish gh-pagesin the terminal of VS Code
- Run
- Fix for the main page loading the ReadMe.md file instead of the portfolio website