diff --git a/examples/example_workflow.md b/examples/example_workflow.md new file mode 100644 index 0000000..71cd2e9 --- /dev/null +++ b/examples/example_workflow.md @@ -0,0 +1,66 @@ +Example Workflow +==== +This is the example we went though during the git revisited seminar. + +###Getting started: +***>>>fork VIC repo*** + + git clone git@github.com:{your_user_name}/VIC.git + cd VIC + +### Review the repo that you just cloned + + git status + git branch + git branch -a + git log + +### Add the upstream repo + git remote -v + git remote add upstream git@github.com:UW-Hydro/VIC.git + git remote -v + +### Fetch the upstream branches + git fetch upstream + git branch -a + +### Merge in the changes from the upstream develop branch + git checkout develop + git merge upstream/develop -X theirs + +### create a new feature branch + git checkout -b feature/testing + git branch -a + git status + +### make changes to repo + vim .gitignore + +### do a git stash to move around a dirty repo + git stash + git pull upstream develop + git stash apply + git log + +### stage some changes + git add .gitignore + +### review the changes + git status + git diff + +### commit the changes + git commit -m "Sample commit message" + +### Review the commit + git status + git log + +### push to github + git push origin feature/testing + +### go to github +- look for new branch +- submit pull request + + diff --git a/examples/hello_hydro/README.md b/examples/hello_hydro/README.md new file mode 100644 index 0000000..d1faaea --- /dev/null +++ b/examples/hello_hydro/README.md @@ -0,0 +1,24 @@ +Hello Hydro +======= + +### Getting started +1. Fork this repo +2. Clone your fork +3. Checkout a new branch + +### Making changes + +This should take less than 5 minutes. + +1. Start by adding a personalized `hello_world` statement to the `letters.py` module. If you don't usually write in Python, the examples in the existing file should allow you to just copy a function (e.g. `hello_joe`) and make a few changes. +2. Call your hello_world function from the `hello_hydro.py` script. This script is executable from the command line. Again, the examples in the script should be sufficient to explain how to do this for the Python beginner. + +### Running the Script +Running `./hello_hydro.py` from the terminal should do the trick. + +Make sure to run the script after you make your changes to make sure it still works. + +### Contribute your changes to the `UW-Hydro` repository. +1. Commit your changes to the two files. +2. Push your changes to your fork +3. Issue a pull request to the `UW-Hydro` repository. diff --git a/examples/hello_hydro/hello_hydro.py b/examples/hello_hydro/hello_hydro.py new file mode 100755 index 0000000..01b2441 --- /dev/null +++ b/examples/hello_hydro/hello_hydro.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +""" +hello_hydro.py + +An example module used for teaching the UW Land Surface Hydrology Group how to +use Python, Git, and Github. +""" + +import letters + +def main(): + + # Say hello to the world + letters.hello_world() + + # Say hello to Joe + letters.hello_name('Today is Thursday') + + # Add your own hello function to letters.py + # Then call that function from here... + + # All done, say goodbye + letters.goodbye_world() + + return + + +if __name__ == "__main__": + main() diff --git a/examples/hello_hydro/letters.py b/examples/hello_hydro/letters.py new file mode 100644 index 0000000..f2045eb --- /dev/null +++ b/examples/hello_hydro/letters.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +""" +letters.py + +A group of personal hello_world functions +""" + +from __future__ import print_function +from datetime import date + + +def hello_world(): + print("Hello world! Today's date is: {0}".format(date.today())) + + +def goodbye_world(): + print("Goodbye world!") + + +def hello_name(my_str): + print("Hello SE-YEUN: {0}".format(my_str)) diff --git a/presentation/GitRevisited_20140225.pdf b/presentation/GitRevisited_20140225.pdf new file mode 100644 index 0000000..d116f22 Binary files /dev/null and b/presentation/GitRevisited_20140225.pdf differ