Using Git in the DSA Program
Course names follow a standard naming convention with one or two letters for the semester (sp, su, or f), the two-digit year, then dsa followed by the course number. Use an asterisk as a wild card after this base name so you don't have to type the underscore and your userid. I will use "sp25dsa7004*" as the example course below.
There is a separate post with Case Study and Capstone Git Advice, for managing your team repositories. This post is for individual student repositories as are used in the other DSA courses.
Submitting Work
- Open a terminal. Our containers have two different interfaces: Jupyter Classic Notebook, and JupyterLab.
- In the Classic Jupyter notebook interface, open a terminal using the New drop-down on the Jupyter directory page.
- In the new containers with the JupyterLab interface, click on the Terminal icon on the Launcher page.
- Once in the terminal, navigate to your course folder by typing and entering the course repo name followed by an asterisk. Our courses follow a naming convention, with the semester, dsa, the course number, underscore and your userid. For instance, for the fall of 2025 for the 7010 course you would see f25dsa7010_userid. The asterisk is a wild card so you don't have to type _userid.
# example of spring 2025 7004 course:
cd sp25dsa7004*- Review your work by checking the status of the files tracked by git.
git statusIn this example, I have modified files in the Module1/labs and Module1/practices which show up under "Changes not staged for commit" and I created one new file which shows up under "Untracked files."
- Now, stage the changes you want to commit - the whole module, or an individual notebook or notebooks. Important: Do not commit data files unless specifically directed to by your instructor.
git add <path to file or folder>
# for example:
git add module1
git add module1/exercises/name_of_notebook.ipynb
# you can add more than one path at a time
git add module1/labs module1/practices- It is advisable to use git status again to make sure the files you want are properly staged under "Changes to be committed."
In this example, I added all the files in the labs folder and the one file in the practices folder in one command by listing them one after the other. I am not adding the new, untracked file. When running git status, I see the files I want are listed under "Changes to be committed."
- Create a commit (i.e., a permanent, historical, save point) with an informative commit message.
git commit -m "This is my module1 work from xx/xx/xxxx"- It is advisable to use git status again to make sure the files you want were committed. They will no longer show up under "Changes not staged for commit," "Changes to be committed" or "Untracked files."
- Send or "push" these changes to the server for safe keeping (i.e., publish.)
git push- Important: use git status again to make sure the files you want were pushed. The git status output should include this message indicating you pushed your changes to the remote successfully.
Your branch is up to date with 'origin/master'.Pulling the Next Module
- Open a terminal and navigate to your course folder as in the above instructions for submitting work.
- Pull the material the instructor has published for you from the upstream master. This will not work until the changes have been deployed, typically no later than Saturday morning at 6am.
git pull --no-edit upstream masterIn this example, I already had modules 1-4 and am pulling module 5, the next deployed module.
Need more information or help? Reach out to us at 📧 jcwdw@missouri.edu