Code and samples from lecture and review sessions
To get class scripts as we add them to this repository, PFB2012, and to add your own files to your own personal repository. The steps were summarized from https://help.github.com/articles/fork-a-repo
This repository and your personal repositories are accessible from github now and later from anywhere. Follow these instructions to set up git and to get started.
Sofia's Definitions
- Repository: A place to store scripts. In our case it is at a remote location on the servers of GitHub.
- Fork : A copy of a repository (repo) that you can change and edit.
- Clone : The act of copying a repo
- Merge : The two files are compared and the differences noted
- git add : Add files to a list of files that are ready for a commit
- git commit: Save a version of the file to be sent to GitHub later with a push
- git push : Send files that have been committed to GitHub
Steps to do only ONE time for set up:
- go to https://github.com/
- create an account.
- set up github on your local machine -- skip the install, go to "set up"
- https://help.github.com/articles/set-up-git
- git config --global user.name "Your Name Here" Sets the default name for git to use when you commit
- git config --global user.email "[email protected]" Sets the default email for git to use when you commit Your email address should be the same one associated with your GitHub account
- https://help.github.com/articles/set-up-git
- change into a directory that you want the repo to go.
- go to https://github.com/srobb1/PFB2012
- Click on the FORK button
- go to http button, copy the address
- To set the repo that is active in your directory of your local machine and to get any files present in the repo for the first time
- type this in your terminal, pasting the address over
- To differentiate your personal PFB2012 repository from the orginal PFB2012 repository
- type this in your terminal (note the username: srobb1)
- cd PFB2012
- git remote add upstream https://github.com/srobb1/PFB2012.git
- this assigns the original repo to a remote called "upstream"
- type this in your terminal (note the username: srobb1)
Steps to update the orginal repository and to add files to your personal repo.
These steps can be done as many times as you like
- To get new files from the orignal PFB2012 repo you need to do this:
- git fetch upstream
- this pulls in changes not present in your local repository, without modifying your files
- To merge the files in your personal repository you can do this
- git merge upstream/master
- You can add keep your own version of everything in your personal repo. Add files, change files, and make directories for problem sets and other notes
- git add path_to_new_file
- git commit -m 'note about file'
- git push origin master