On Github CaffGeek / reveal.gitdevops
Created by Chad Hurd / @caffgeek
Introduction
Why Git?
Command Line Walkthrough
Leverage Git with Webhooks
If time, Vagrant
Branches are FAST and Easy
Undo almost everything
local/offline source control
Everyone has a copy of the FULL repository
Language agnostic
2009: 2.4% 2010: 6.8% 2011: 12.8% 2012: 27.6% 2013: 30.3% 2014: 33.3%
2009: 57.5% 2010: 58.3% 2011: 51.3% 2012: 46.0% 2013: 37.8% 2014: 30.7%
Team Foundation Version Control
Standards compliant, not custom git
Git, based on libgit2 (same as github)
Industry Support
#create a new repository git init #clone a repository git clone http://gihub.com/caffgeek/reveal.gitdevops #get the changes from the server git pull #basically a fetch then merge #check what has changed git status #commit changes locally git add -A #stages all changes git commit -m "checkin message" #push changes to git server git push
GUIs are great, once you understand what's happening under the hood
Learn how it works better on the CLI
Command line is faster, I didn't go back to the GUI
Still a central server (normally)
Each node has a full repo
Share without using central server
100% Redundancy
status = friend
what's changed?
need to add to staging area
how you select files to commit
Added all with -A
Individual with filename (wildcards)
Commits are local
1st time, went weeks before realizing
status shows us we're behind master...
work without central repo
Sends to remote repository
SUPER SUPER FAST
Just pointers
in branch and commit, pointer moves with you
c7 = merged code...classic
might not be conflicts
If you need to "push -f"
you are rewriting history
peers don't have those changes
Webhooks = new
github-services = old
Build integrations
Subscribe to events on GitHub.com (fork, delete, create, etc)
Send HTTP POST payload
Only going to go into a few of these
bamboo($) by atlassian (jira)
versioneye - also daviddm for node (packages.json)
language: node_js node_js: - "0.10" notifications: slack: caffgeek:coKj2K5otFWUcZ6e8hY3h8Rn
Ruby, JavaScript, PHP (Beta), Python (Beta)
Automatically open issues for code smells - http://github-service-universe.kimminich.de/#/18/6
exclude paths
specific languages
instead of guessing
Jira
GitHub Issues
Pivotal
No trello(?)
watches your repositories package.json and bower.json
package.json - node
bower.json - javascript
Daily/Weekly/Monthly/Never
Public/Private
single file description of a machine
base image
provision
configure
virtual box
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "hashicorp/precise32" config.vm.network "forwarded_port", guest: 1337, host: 8337 config.vm.synced_folder ".", "/vagrant" config.vm.provision "shell", path: "sh/provision.sh" config.vm.provision "shell", path: "sh/startup.sh", run: "always" end
# Change the hostname so we can easily identify what environment we're on: echo "nodejs-vagrant" > /etc/hostname # Update /etc/hosts to match new hostname to avoid "Unable to resolve hostname" issue: echo "127.0.0.1 nodejs-vagrant" >> /etc/hosts # Use hostname command so that the new hostname takes effect immediately without a restart: hostname nodejs-vagrant # Install core components apt-get update # Install build tools apt-get install -y make g++ git curl vim libcairo2-dev libav-tools nfs-common portmap # Install Node.js # Modified from https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager apt-get update apt-get install -y python-software-properties python g++ make add-apt-repository -y ppa:chris-lea/node.js apt-get update apt-get install -y nodejs apt-get install screen npm install supervisor -g
echo "Running node-supervisor with screen" screen -d -m /vagrant/sh/node-supervisor.sh
supervisor --watch /vagrant /vagrant/server.js