Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leesy example branch #1

Open
wants to merge 5 commits into
base: git_training_branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions examples/example_workflow.md
Original file line number Diff line number Diff line change
@@ -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 [email protected]:{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 [email protected]: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


24 changes: 24 additions & 0 deletions examples/hello_hydro/README.md
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 29 additions & 0 deletions examples/hello_hydro/hello_hydro.py
Original file line number Diff line number Diff line change
@@ -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()
21 changes: 21 additions & 0 deletions examples/hello_hydro/letters.py
Original file line number Diff line number Diff line change
@@ -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))
Binary file added presentation/GitRevisited_20140225.pdf
Binary file not shown.