Palantir.net presents Git

Similar documents
Gitflow process. Adapt Learning: Gitflow process. Document control

Version Control using Git and Github. Joseph Rivera

Version Control! Scenarios, Working with Git!

Version Control with. Ben Morgan

Version Control with Git. Dylan Nugent

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

PKI, Git and SVN. Adam Young. Presented by. Senior Software Engineer, Red Hat. License Licensed under

Git Branching for Continuous Delivery

MATLAB & Git Versioning: The Very Basics

Unity Version Control

Annoyances with our current source control Can it get more comfortable? Git Appendix. Git vs Subversion. Andrey Kotlarski 13.XII.

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

Introducing Xcode Source Control

Version Control with Subversion and Xcode

Version Control for Computational Economists: An Introduction

Introduction to the Git Version Control System

Version Control Systems (Part 2)

Lab Exercise Part II: Git: A distributed version control system

Source Control Systems

FEEG Applied Programming 3 - Version Control and Git II

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

DJANGOCODERS.COM THE PROCESS. Core strength built on healthy process

Putting It All Together. Vagrant Drush Version Control

Version control with GIT

Continuous Integration. CSC 440: Software Engineering Slide #1

AVOIDING THE GIT OF DESPAIR

Introduction to Source Control ---

Surround SCM Best Practices

Version Control Systems: SVN and GIT. How do VCS support SW development teams?

Version Uncontrolled! : How to Manage Your Version Control

Understanding Code Management in a Multi-Vendor Environment. Examples of code management in a multi-team environment

Using Microsoft Azure for Students

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

CSCB07 Software Design Version Control

MOOSE-Based Application Development on GitLab

Version Control with Git

GECKO Software. Introducing FACTORY SCHEMES. Adaptable software factory Patterns

Two Best Practices for Scientific Computing

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

LINCHPIN EVERYONE IS A PROJECT MANAGER, YOU CAN TOO!

Continuous integration with Jenkins CI

Improving your Drupal Development workflow with Continuous Integration

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Tipps and Tricks. Softwaretechnik II 2014/15 Thomas Kowark

ICS Service Desk Call and Ticket Handling Procedures

Version Control with Git. Kate Hedstrom ARSC, UAF

SA Tool Kit release life cycle

Puppet Firewall Module and Landb Integration

Continuous integration, package update mechanism and release management in GAP

Continuous Integration

Optimizing Your Software Process

Eliminate Workflow Friction with Git

Week G Versioning with svn

How to get MOSS 2007 dev. environment set up in Vista with sample project.

How To Send Your Newsletter

Introduc)on to Version Control with Git. Pradeep Sivakumar, PhD Sr. Computa5onal Specialist Research Compu5ng, NUIT

Revision control systems (RCS) and

[Handout for L6P2] How to Avoid a Big Bang: Integrating Software Components

Content. Development Tools 2(63)

Introduction to Subversion

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Git. A Distributed Version Control System. Carlos García Campos carlosgc@gsyc.es

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Offshoring Answers. Organizational Development Factor. Financial and Cost Factor. Skills and Technology Factor

Version control systems. Lecture 2

Using Oracle Cloud to Power Your Application Development Lifecycle

Drupalcamp Vienna 2009

Online Meeting Best Practices. How to Host Successful Online Meetings. A detailed guide on the three online meeting stages:

Software Configuration Management Best Practices

How to set up SQL Source Control. The short guide for evaluators

Frog VLE Update. Latest Features and Enhancements. September 2014

Version Control Using Subversion. Version Control Using Subversion 1 / 27

Testing Rails. by Josh Steiner. thoughtbot

Data management on HPC platforms

Version Control with Mercurial and SSH

Successful PaaS and CI in the Cloud

MAILCHIMP INTEGRATION:

Subversion Integration for Visual Studio

Version Management with Subversion for Designers

Software Engineering I (02161)

The Web Pro Miami, Inc. 615 Santander Ave, Unit C Coral Gables, FL T: info@thewebpro.com

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

Agent s Handbook. Your guide to satisfied customers

GO!Enterprise MDM Device Application User Guide Installation and Configuration for ios with TouchDown

Zero-Touch Drupal Deployment

ISVforce Guide. Version 35.0, Winter

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Source Code Control & Bugtracking

Module 11 Setting up Customization Environment

SUCCESFUL TESTING THE CONTINUOUS DELIVERY PROCESS

Web Developer Toolkit for IBM Digital Experience

PERSONAL WEBSITE DEVELOPMENT 101. Brought to you by the UB Graduate Student Association webmasters: Holly Keily & John Beverley

Nexus Professional Whitepaper. Repository Management: Stages of Adoption

Modelica Language Development Process Version June 27, 2015

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

Introduction to Version Control

Dry Dock Documentation

Transcription:

Palantir.net presents Git Branching, Merging, Commits, and Tagging: Basics and Best Practices

Git Started This assumes you already have a repo. Instructions for that are already on Github.

Branching

BRANCHING Naming Your New Baby Branch There are four types of branches: Master Release-[x] Feature-[x] [xx]-support

BRANCHING The Master The Master branch should, at all times, reflect what is on the client s live site. When a phase of development is to be released to the client, the release-[x] branch is merged into the Master.

BRANCHING Release-[x] All development for project phase [x] happens in a branch named release-[x] * i.e., phase one of development happens on the release-1 branch. Development on release-1 will often continue post launch while work has also begun on release-2. * (where [x] starts at 1 and increments with each new project cycle)

BRANCHING Features and Support These are branches that any dev can create. Release-[x] and master are only touched by the team lead. Devs will create a feature or support branches as needed. These are merged into release-[x] by the Lead when finished.

BRANCHING Feature Branches Development for pre-launch features are branched from release-[x]. Prefix with the release branch to which they relate. Add ticket numbers where applicable. e.g. release-1-widget-of-doom for doom_widget.module in phase 1. When ready, it gets merged back into release-1 and then deleted.

BRANCHING Support Branches Development for post-launch support tickets are branched from master. Branch names should consist of a ticket number and a short description. Development for support ticket #57: Widget is full of bugs would be done on a branch named 57-widgetof-bugs.

BRANCHING Naming your branch well is important. Almost all metadata about the branch lives in the name.

BRANCHING Your Very Own Branch 1. Create your own branch 2. Write some code 3. Stage it 4. Commit it 5. Push it

BRANCHING Your Very Own Branch 1. Create your own branch 2. Write some code 4. Commit it 5. Push it 3. Stage it // Create your new branch. $ git checkout -b new-feature-awesome-branch // Write some awesome code, then stage it. $ git add my-awesome-code.inc // Look it over. (the cached parameter shows you stuff you ve already staged.) $ git diff --cached (Press q when you re done looking at it.)

BRANCHING Your Very Own Branch 1. Create your own branch 2. Write some code 4. Commit it 5. Push it 3. Stage it //Commit it. $ git commit m- This is my commit message //Push it. $ git push -origin new-feature-awesome-branch* * You only have to do the -u and everything after that the first time you push the branch. If you don t have a remote set up, check out the link to Github s instructions on slide #2.

Merging

MERGING Get Ready When your branch has reached perfection, it s ready to be merged.

MERGING Clean Merge The downstream person is responsible for maintaining a branch that will merge back up cleanly.

MERGING Feature Branch Start from the latest release branch version by merging it into your feature branch. //If you don t have the branch yet, check it out. $ git checkout feature-x //Or if you do have it, pull the latest code. $ git pull //Update the feature branch* (with up-to-date release branch) $ git merge origin/release-x

MERGING Merge Conflicts Fix any merge conflicts. Consult with the author(s) of the changes Consult with the Team Lead Use a merge tool When in doubt, have a merge party * Communicate, communicate, COMMUNICATE!

MERGING Merge Tool * Wait, what merge tool? If you don t yet have a favorite merge tool, Gitx is a must See what other people are doing Be aware of your project history Investigate Git mysteries (!!!) See when you haven t pushed yet

MERGING Push It Push your updated version of the feature branch: $ git push Test. If testing was unsuccessful, note that in the ticket. You re done. If testing was successful, continue.

MERGING Do the Merge // Check out the release branch to do mergery on it $ git checkout release-x // Here it comes! The real merge! $ git merge feature-x Optionally add a more useful commit message for the merge with $ git commit --amend

MERGING A Clean Send Send it off: $ git push Clean up: // Delete the remote feature branch after merge $ git push origin :feature-x // Delete the local feature branch after merge $ git branch -d feature-x

MERGING Multi-Layered Approach The tip of master is always stable release-[x] is what Pro Git calls a dev branch release-[x]-feature and [xx]-supportbranch are subsidiary branches

MERGING Multi-Layered Approach This keeps production, staging, and development separate. Why? To protect the codebase and to give adequate opportunity for review before pushing to production.

MERGING What Should You Be Doing? You should be developing in branches that you create as needed Feature branches branch off of release-[x] and are named for the feature and release Support branches off of master and are issue-number-keyed

Commits

COMMITS What Should You Be Doing? Making commits that are Small Frequent Well-commented To support of feature branches Commit Early. Commit Often.

COMMITS A Note About Compiled CSS SASS compiles to CSS. If you edit a SASS file, those changes go in a commit that excludes the compiled CSS. 1. Edit the.scss file. 2. Commit the.scss file with a concise, but descriptive message. 3. Commit the.css file in a separate commit. A generic message is ok here. 4. If/when a merge conflict ever occurs, the mergeon* will resolve the conflict and then generate new compiled CSS** * Mergeon n. 1. person doing the mergery. ** Mergery is performed on compiled CSS by running $ compass clean and then $ compass watch (assuming you re using Compass.)

COMMITS Commits Make small commits. Why? To mitigate merge conflicts.

COMMITS Well-Commented Commits Commits should have concise description in commit messages. Why? Many well-commented commits form a roadmap of how you got to the final release. Also helps you prepare for meetings.

COMMITS Trackable Commits Support commits should have the ticket number* in the commit. Why? To enable integration with issue tracker,* and to provide background info. *Assuming you re using an issue tracker such as those provided by Redmine, Jira, Github, etc.

Tagging

TAGGING Making Tags $ git tag lists tags. $ git tag -a v#.#.# -m Comment. creates a tag with a release number and a comment. Read more about tagging in git: Git Ready Pro Git

TAGGING Pushing Tags $ git push --tags or $ git push [tag-name] If you want to push your tags somewhere other than origin, specify. Make sure to push tags AND code.

TAGGING Releasing Tags Release tags are always on the master. v1.1.2 This release introduces support for foo and bar.

TAGGING Eventually, someone will screw up the tag number sequence.

TAGGING Annotating Tags Tagging with -m records the following with the tag a message a timestamp a user $ git tag -m v#.#.# Comment. Note: If you type it without a comment in quotes, it will pop up a vim window for you to put your comments in.

TAGGING Annotating Tags Tagging with -a records the following with the tag a timestamp a user $ git tag -a v#.#.# *Tagging with -a doesn t let you leave a message with the tag. It s better to include a message, but at least this way you can find out who to hunt down and ask about this release.

TAGGING Annotating Tags Tagging with -m gives message, timestamp, and a user (pops up message) $ git tag -m v1.0.0 Added support for foo bar baz. Tagging with -a gives you a timestamp and a user. $ git tag -a v#.#.# Use these to avoid starting a war with your future self.

TAGGING Releases Releases are roughly aligned by name with project milestones. The stages of a release cycle are: Project begins Project is ready for Internal QA (alpha tags) Project is ready for client review (beta tags) Project is ready for release

TAGGING Releases NOTE: Project with multiple phases with separate launch dates = separate release cycles Client with multiple separate engagement contracts = separate release cycles

SUMMARY tl;dr Branches get descriptive names. Development happens on feature/support branches. Keep dev/stage/prod branches separate Tag master releases with annotated tags. Commit early, often, and with concise messages. When in doubt, communicate, communicate, communicate.

SUMMARY Resources Pro Git (public) Git Ready (public)

SUMMARY Credits Bec White said the thing about starting a war with yourself. Beth Binkovitz wrote the words and put in the funny pictures. Palantir design team helped with the template.

Thanks! Beth Binkovitz binkovitz@palantir.net