Table of contents
PHY432 Workflow: Resources and Workspace
Code, notebooks, and files are being made available on GitHub in the resources repository Py4Phy/PHY432-resources. For the rest of the semester it will be assumed that you have a ~/PHY432-resources
repository that you can update with a simple git pull
as soon as new material is posted.
If you have not done so already, clone ~/PHY432-resources
:
You should also have your own workspace repository ~/PHY432
set up.
Overview
When we start a new lesson you will typically go through the following steps to get code and data files.
- pull latest changes from PHY432-resources
- copy the new directories and files into your workspace PHY432
- work in your workspace
- commit changes in your workspace
- (optional) push changes in your workspace your GitHub repository
Update resources (“pull resources”)
Update when your instructor changed anything on the remote:
Check what’s new
(newest at top)
Copy new files and directories to workspace (“copy resources”)
You should not be changing anything inside ~/PHY432-resources
(because the next git pull
might try to change something that you did 1) but instead copy whatever you want to change to your own work directory.
For example:
Work, commit, push
Then work on the files in the workspace.
When you have changes that you want to track, git add / commit / push
:
Footnotes
If you happen to have accidentally edited files inside
~/PHY432-resources
you might run into merge conflicts when you rungit pull
the next time. If that happens, copy all files that you edited (usegit status
to see which ones are modified) to a safe directory and then reset with the commandcd ~/PHY432-resources # Next command only if you ran into a merge conflict # during a 'git pull' git merge --abort # undo ALL of YOUR changes git reset --hard HEAD
WARNING
This will undo all your changes but will allow you to just run the next
git pull
command again without problems. ↩