Version Control using Git and Github. Joseph Rivera



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

Introduction to the Git Version Control System

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

Version control with GIT

MOOSE-Based Application Development on GitLab

Version Control with Git. Kate Hedstrom ARSC, UAF

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

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

MATLAB & Git Versioning: The Very Basics

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

FEEG Applied Programming 3 - Version Control and Git II

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

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

Using Git for Project Management with µvision

Version Control with Git

Version Control! Scenarios, Working with Git!

Version Control with. Ben Morgan

Data management on HPC platforms

Version Control with Git. Dylan Nugent

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

Source Control Systems

Version Control Systems (Part 2)

Version Control with Git

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

Introduction to Version Control

Distributed Version Control with Mercurial and git

Introduction to Version Control with Git

Two Best Practices for Scientific Computing

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

An Introduction to Collaborating with Version Control

Distributed Version Control

How to Create a Free Private GitHub Repository Educational Account

Using Git for Centralized and Distributed Version Control Workflows - Day 3. 1 April, 2016 Presenter: Brian Vanderwende

Pro Git. Scott Chacon *

Version Control. Version Control

A Git Development Environment

Palantir.net presents Git

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer GIT

Version Control for Computational Economists: An Introduction

Derived from Chris Cannam's original at, an.

An Introduction to Git Version Control for SAS Programmers

Advanced Computing Tools for Applied Research Chapter 4. Version control

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

Using GitHub for Rally Apps (Mac Version)

Introduction to Version Control with Git

Software Configuration Management and Continuous Integration

An Introduction to Mercurial Version Control Software

Environnements et Outils de Développement Cours 7 Version Control

Dalhousie University CSCI 2132 Software Development Winter 2015 Lab 7, March 11

Zero-Touch Drupal Deployment

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

Version Control Systems

Version Control with Mercurial and SSH

Version Control Script

Developer Workshop Marc Dumontier McMaster/OSCAR-EMR

Work. MATLAB Source Control Using Git

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

Software configuration management

DevShop. Drupal Infrastructure in a Box. Jon Pugh CEO, Founder ThinkDrop Consulting Brooklyn NY

Continuous Integration. CSC 440: Software Engineering Slide #1

Git, GitHub & Web Hosting Workshop

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.

Unity Version Control

Introducing Xcode Source Control

Version Uncontrolled! : How to Manage Your Version Control

Using Subversion in Computer Science

Dry Dock Documentation

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

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

CS 2112 Lab: Version Control

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

An Introduction to Mercurial Version Control Software

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

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

Source Code Control & Bugtracking

ECE 4750 Computer Architecture, Fall 2015 Tutorial 2: Git Distributed Version Control System

Subversion. Nadir SOUALEM. Linux Users subversion client svn or higher. Windows users subversion client Tortoise 1.6.

Drupalcamp Vienna 2009

Version control systems. Lecture 2

Many projects, one code

Source Code Management/Version Control

Platform as a Service and Container Clouds

Revision control systems (RCS) and

Git in control of your Change Management

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Git - Working with Remote Repositories

Putting It All Together. Vagrant Drush Version Control

1. History 2. Structure 3. Git Comparison 4. File Storage 5. File Tracking 6. Staging 7. Queues (MQ) 8. Merge Tools 9. Interfaces

Working Copy 1.4 users manual

Version Control with Subversion

Type-C Ubuntu Product & Strategy Canonical Ltd.

How To Manage Source Code With Git

Git Fusion Guide August 2015 Update

ALERT installation setup

Remote Desktop With P2P VNC

What Does Tequila Have to Do with Managing Macs? Using Open Source Tools to Manage Mac OS in the Enterprise!

Using SVN to Manage Source RTL

Gitflow process. Adapt Learning: Gitflow process. Document control

Mantis Bug Tracker Developers Guide

Getting Started With! CGminer/BFGminer!

Transcription:

Version Control using Git and Github Joseph Rivera 1

What is Version Control? Powerful development tool! Management of additions, deletions, and modifications to software/source code or more generally any documents or files. Attempts quality documentation of changes throughout lifetime of software or document development. Version Control System Usually a standalone application used to keep track of revisions. Can be used on servers or with a website (like Github or Wikipedia) 2

Why is Version Control Necessary? Keeps older versions with a history of all changes made. If you break something vital, and can t figure out what you did Roll back to a working version! Compare old implementations vs. new implementations See when and why changes were made Managing multiple users What if you want to develop a new functionality? Create a branch that can be manipulated without affecting the original version! When the branch is ready, you can merge it back in, handling any conflicts that may arise. Keep track of who made what changes when, and why You can comment about each commit you make, explaining your changes 3

Git ~ The Stupid Content Tracker A Distributed Version Control System Each user has a complete copy of the repository Protects against central repository failure Work on your own without messing up other people s stuff Meritocracy without complete loss of control Developed by Linus Torvalds (Creator of Linux) Initially created for use in Linux Kernel development Open Source, so you can learn about version control (and make it better)! Primary Goals Speed Non-linear development support distributed 4

GitHub ~ Build software better, together Online project hosting for Git version control repositories Great way to spread open source code. Free hosting of public repositories, each up to ~1GB Students can get 5 free private repos for 2 years Pricing plans for more serious private repos Why use it? Great way to get experience and show off what you can do Keep track of statistics about your projects Easy access to your repos Good for team management 5

Git ~ Basics Install Git using a package manager or build from source sudo pacman S git (Arch Linux) sudo apt-get install git-core (Ubuntu) Creating a Git repository Clone an existing repository (remote or local) Creating a new repository git init Set default username and email git config --global user.name John Doe git config --global user.email jdoe123@gmail.com Set default editor git config --global core.editor emacs Clone remote repository (using http) git clone https://github.com/jrivera777/opengl-asteroids.git Clone local repository git clone file:////<host>/<share>/<path> 6

Git ~Basics (Cont) 7

Git ~Basics (Cont) Add file to be tracked Tracked files will have changes stored during a commit (called staging), and eventual push. git add README.md Untracked files will begin being tracked and are staged. Stop tracking files git rm stupidfile Forget changes made to file git checkout -- file.txt Commit changes git commit git commit m A commit message! If you want to just stage all tracked changes and commit them git commit a Not using the m flag will make a default editor show up asking for commit message. This is useful for more detailed messages. 8

Git ~Basics (Cont) Check tracked and staged files git status Shows all files that are going to be committed (staged files) Shows files that have been removed and un-staged Shows files that have been modified, but are not staged Seeing modifications not yet staged git diff Add --cached/--staged show staged changes instead 9

Git ~ Basics (Cont) Oftentimes after forking a repo, you wish to retrieve any changes made on that repo We may also wish to track other people s forks of the same project. Show tracked external repositories Note: After a git clone you will have a remote called origin git remote Add new remote tracking git remote add upstream git@github.com:pantherlinuxusergroup/plug-wall.git 10

Git ~ Basics (Cont) Pushing your commits to a remote repository Changes the remote repository to reflect all changes made during commits on your local copy git push [remote-name] [branch-name] git push origin master Pushes changes (commits) made in your local master branch to the remote origin branch. Cloning sets up these names automatically. If someone else has pushed before you, this command fails (as it should)! Why? Pulling and incorporating changes from a remote repository git pull upstream master Attempts to retrieve changes in the master branch of the remote repository named upstream. If conflicts occur with commits you made locally, you can resolve them at this point. 11

Git ~ Basics (Cont) Creating Branches You wish to work on new functionality or bug fixes without compromising your stable code base. Show existing branches and current branch git branch Create new branch git branch New-Branch Move into a branch git checkout New-Branch Create new branch and move into it git checkout b New-Branch 12

Git ~ Basics (Cont) After working on changes or new functionality, we will eventually be ready to make it part of the primary code base. If no conflicts occur, all code from one branch is put into another. Usually branches are merged into a master branch. Merging branches git checkout master (move into main branch) git merge Issue77 git branch d Issue77 (delete successfully merged branch) If conflicts occur, you can use git status and git diff to make changes, commit then, and re-attempt the merge. 13

Git ~Basics (Cont) Still not sure about a command? git help Shows a synopsis of the most commonly used commands git help <command> gives details about a particular command -a lists all commands 14

Github Many different visualizations of project progression Issue tracking system Generate pull requests to add your work to projects you ve forked from Comment system for issues, commits, pull requests, and more. Great place to read other people s code, get ideas, and explore trending repos 15

Resources Want more information or examples about git and it s commands? Visit: http://git-scm.com/book http://www.ericsink.com/vcbe/ https://github.com/ Ask PLUG officers and members! 16