Working in your Fork on GitHub.com#
This is a short document on keeping track of your work on GitHub. There five steps:
fork the computational-mechanics repository
clone your forked repository to your Jupyter server
keep your fork updated with a ‘fetch upstream’ on github.com
do your work then commit your changes
push your changes to github.com
Steps 1 and 2 only have to be performed once.
Only do steps 3, 4, and 5 to keep your work up-to-date.
1. fork the computational-mechanics repository#
log in to github.com with your GitHub user name
click “fork” in the upper-right corner of the website
2. clone your forked repository to your Jupyter server#
log in with your netid and password
Click “New” -> “Terminal”
type these commands, but replace
your-user-name
with your GitHub user name
cd work
git clone https://github.com/your-user-name/computational-mechanics.git
You now have a copy of your fork on your Jupyter server
3. keep your fork updated with a ‘fetch upstream’ on github.com#
When changes are made to the main code, you’ll want to update your files in your fork. Do this in 2 steps:
go to
https://github.com/your-user-name/computational-mechanics
replacingyour-user-name
with your GitHub user nameClick the button “Fetch upstream”
4. do your work then commit your changes#
After you have made changes e.g. you finished the first notebook’s problems, you’ll want to “commit” those changes to git. Then, push them to github.com
Save any work with the
On the main compmech site Click “New” -> “Terminal”
type these commands
cd work/computational-mechanics
git pull origin master
git add .
git commit -m 'my latest work message'
5. push your changes to github.com#
Then, to push the changes to github.com type this command
git push origin master