COAWST from svn 7/16/19, Version 3.4
Notes:
- Words that look in the instructions are placeholders and should be replaced with the name you are using; do not keep the brackets <>'s.
- Kristen initialized the CSOMIO/COAWST repository 7/16/19 from the COAWST svn repo. It's history has been preserved.
- I added in the one change to the original COAWST repo, which was a small change by Courtney to a compiler file
- I have registered for a free improved github account as being a teacher/researcher. You all have this option too (there is also an option for students).
- CSOMIO/COAWST is the group, collective, shared code repository of COAWST (located at https://github.com/CSOMIO/COAWST). We want to keep it clean of any changes except when we intend to share improved code that already works and doesn't break anything.
- repo == repository which is a code storage spot
- you'll want to stay up to date with the CSOMIO/COAWST master branch so that you don't have a harder time merging the code later and having to potentially change some of your own implementation.
Common github commands for reference:
git status
: check what has been added, changed, what branch you are ongit pull
: get changesgit push
: share changes
More information about git: https://www.smashwords.com/books/view/498426
Instructions for setting up and using git/github to maintain code and collaborate:
- Get a github account of your own.
- Fork CSOMIO/COAWST to your own github profile:
- on page https://github.com/CSOMIO/COAWST, click "fork" in upper right hand
- I clicked "fork to... kthyng/COAWST", since kthyng is my own github user account
- Clone the COAWST repo from your github account to your computer
-
Click the green "clone or download" button on https://github.com//COAWST (but with your github profile name in there) and copy the link to clipboard
-
On your computer, open terminal window and navigate to where you want to clone repo and type
git clone https://github.com/<username>/COAWST.git
but with as your github username. This will bring all of the COAWST repo to the clone location, and call the directory "COAWST"
-
- Do your work on COAWST on your own computer(s) and keep it version controlled with your github profile and with a branch; don't work on the master branch directly.
-
Set up a remote to the group CSOMIO/COAWST repo. This will allow you to get new code when someone else has put in their part or other changes have been made.
-
git remote add upstream https://github.com/CSOMIO/COAWST.git
-
You can check your remotes with
git remote -v
- This shows you the github repos that you are connected with. You will have "origin", which points to your fork of COAWST on github, and "upstream" which points to the original group CSOMIO/COAWST.
-
You can later get updates from CSOMIO/COAWST with
git pull upstream master
. You may have to merge the code with your code. Google for an example for how to merge. It's not hard generally, but you have to go through by hand if git can't figure out how to do it all automatically (that is, if you made edits to the same place someone else did).
-
-
Make a new branch in your version of COAWST in the terminal window with
git branch <branchname>
-
Work in your branch by checking out the branch:
git checkout <branchname>
-
You can always check which branch you are in and what has been changed with
git status
-
-
After you make changes to your code that you want to preserve (which you should do frequently), do these steps:
-
add the files with changes that you want to have tracked with version control:
git add <filenames>
-
check they are added appropriately with
git status
-
-
commit the changes you have made to your local git so the changes aren't lost:
git commit -m '<commit message>'
- the better your commit message is, the more everyone will like you
-
push the changes to github so they aren't only on your computer and so that you can share them:
git push
- If this is the first time you are pushing your branch, it will pop up and tell you what to do
-
-
If others want to work on your branched code too:
- Set up the other person's branch (on otheir github profile) as a remote so that you can pull their branch to be a branch in your profile.
-
To add the oil branch from DJ's github profile to my local machine, set up his repo as another remote:
git remote add oil https://github.com/dkobashi/COAWST.git
-
Grab DJ's code but without integrating it:
git fetch oil
-
Locally change to the branch you are wanting to use:
git checkout --track oil/csomio-oil
-
Later you can update your code if DJ has made changes:
git checkout foo
git pull
-
DJ will be able to get your code changes too via a pull request.
-
Later once your code is integrated together and it works correctly, you can proceed down this list to share the code more widely.
-
- Set up the other person's branch (on otheir github profile) as a remote so that you can pull their branch to be a branch in your profile.
-
If your code is completed, or at a stage where it won't break your master code (be sure of this), merge it with your master branch:
-
git checkout master
-
git merge <branchname>
-
now the changes from your branch are in the master branch of your local version of COAWST
-
push the changes to your github profile so they aren't just on your computer:
git push
-
-
If you want to share this code widely and it is ready to be integrated into the master branch of the CSOMIO/COAWST repo (which means it is ready to be used by others), then do a pull request:
- From your github profile COAWST or CSOMIO/COAWST, click on pull request and follow directions. Others will need to look at your code and it will need to be merged with the existing code.
-