Who we are

Nathan TrenholmPartnerData Insight PartnersCohort 6
Daphne JenkinsData EngineerFayette County Public SchoolsCohort 5
Jason BeckerChief Product OfficerAllovueCohort 4
Billy BuchananDirector of Data, Research, & AccountabilityFayette County Public SchoolsCohort 5
Slides available at: https://wbuchanan.github.io/sdpConvening2017

Roadmap

  1. Intro to Git
  2. Challenges for New Users
  3. Collaborative Work Flows
  4. Product Management Strategies
  5. Q & A

Intro to Git

git init .

git add .
git commit -a "Git Basics"
git push daphne

git pull nathan
git branch daphne

Challenges for New Users

Giving It Thought

  • Usefulness
  • Collaboration
Giving It Thought
Usefulness
  • My current work involves writing SQL queries against our SIS system to import, pull, update, and delete data.
    • The challenge is personal.
  • Future possibilities
    • The challenge can be overcome.
Giving It Thought
Collaboration
  • Within the agency
    • The challenge is trying to figure out how/if this will happen.
  • Outside of the agency
    • Public vs. Private Git Repositories
    • The challenge is ethical.

Giving It Time

  • Constraints
  • Learning
Giving It Time
Constraints
  • Slow and steady
  • Windows vs. Mac
  • The challenge is time.
Giving It Time
Learning
  • Lingo
    • GitHub, Git Shell, Gitignore, Pull Request, Push Request, Fork, Branch, etc.
    • The challenge is figuring out what everything means.
  • Helpful Resources

git add newUserPerspective
git commit -a "Help New Users"
git push jason

git pull daphne
git branch jason

Collaborative Workflows

git add .
git commit -a "Team Workflows"
git push billy

Product Management

git pull jason
git branch billy

Configuring Git

mkdir -p ~/.git_template/{hooks,info}
cp [repo]/.gitconfig ~/.git_template/info/exclude
cp [repo]/.gitattributes ~/.git_template/info/attributes
git config --global core.excludesfile '~/.git_template/info/exclude'
git config --global core.attributesfile '~/.git_template/info/attributes'

git add securityConcerns
git commit -a "Good enough for DoD?
Good enough for me."

Submodules


# Move to a location where you will clone the repository on your machine

cd ~/Desktop/Programs/other

# Clone the hello-world example

git clone https://github.com/wbuchanan/hello-world.git

# Move to the directory where the repository was cloned

cd hello-world

# Create a new branch to work on

git checkout -b submoduleExample

# Add a submodule

git submodule add https://github.com/wbuchanan/hello-submodule submodule

# Check the status

git status

# New file starting with git so we'll look at it

cat .gitmodules

# There's also a new directory called submodule that we want to look at

ls -lah submodule

# If we look at the log in the root directory we only see the root directory changes

git log

# Move into the submodule subdirectory

cd submodule

# Now, if we look at the log we only see the log for the submodule

git log

# Move back into the root directory

cd ../

# If you want to remove the submodules it is a bit more involved

git submodule deinit -f submodule
git rm -f submodule .gitmodules

# Now move back to the original master

git checkout master

If you like savings and you like bacon...


# You can create a new branch based on a specific point in time

git checkout -b newBranchOldCode 2cbc7a4ecd5f041e3777707635afacd50e7ba225

# And now all of the history is gone from this branch

git log

# and can easily get back to the point in time that we need

git checkout master

# And verify it

git log

#### Warning do not use git reset without first using git stash

# Stash your changes

git stash

# Show the stashed changes

git stash list

# Git reset

git reset --soft 2cbc7a4ecd5f041e3777707635afacd50e7ba225

# When you really just need to blow things up and get rid of the painful memories

git reset --hard 6c8487392b19ce6db1d75b276a1356b9fdeb07c5

# Apply the stashed changes

git stash apply

# Can also apply a specific stashed change

git stash apply stash@{0}

git add productManagement
git commit -a "Git Saves The Day"
git push -u origin master

Questions?