Derived from Chris Cannam's original at, https://code.soundsoftware.ac.uk/projects/easyhg/wiki/sc2012bootcamppl an.



Similar documents
Version Control Script

CS 2112 Lab: Version Control

Version Control with Git. Dylan Nugent

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

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.

Version control with GIT

MOOSE-Based Application Development on GitLab

FEEG Applied Programming 3 - Version Control and Git II

Introducing Xcode Source Control

MATLAB & Git Versioning: The Very Basics

Version Control with Git

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

Version control systems. Lecture 2

Data management on HPC platforms

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

Introduction to Version Control

Distributed Version Control with Mercurial and git

Version Control with. Ben Morgan

Version Control Systems

Version Control! Scenarios, Working with Git!

Version Control with Git. Kate Hedstrom ARSC, UAF

Version Control using Git and Github. Joseph Rivera

Mercurial. Why version control (Single users)

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

Using Git for Project Management with µvision

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

An Introduction to Mercurial Version Control Software

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

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

Git - Working with Remote Repositories

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

An Introduction to Mercurial Version Control Software

Adopting a Collaborative Software Development Process in the Scientific Community

Version Control with Git

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

Source Control Systems

Two Best Practices for Scientific Computing

Version Control. Version Control

Version Control with Subversion and Xcode

Revision control systems (RCS) and

Version Control with Mercurial and SSH

Unity Version Control

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

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

Introduction to Version Control with Git

Version Control Systems (Part 2)

VFP Version Control with Mercurial

OSPI SFTP User Guide

Xcode Source Management Guide. (Legacy)

FOG Guide. IPBRICK International. July 17, 2013

User Manual. COBA Server Manager ID UM.L

Version Control Tutorial using TortoiseSVN and. TortoiseGit

Introduction to the Git Version Control System

File Transfer Examples. Running commands on other computers and transferring files between computers

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

Version Control for Computational Economists: An Introduction

Version Control with Subversion

Introduction To Version Control With Mercurial

An Introduction to Git Version Control for SAS Programmers

Version Control with Subversion

CVS versus BitKeeper A Comparison

Using SVN to Manage Source RTL

Using SVN to Manage Source RTL

A Brief Introduction to the Command Line and Git

COMP by H M Ishrar Hussain ID#: (Team 6)

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

Technical Writing - Advantages of Version Control Systems

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

Source Control Guide: Git

Using Subversion in Computer Science

Zenoss Resource Manager ZenUp Installation and Administration

During your session you will have access to the following lab configuration. CLIENT1 (Windows XP Workstation) /24

Version Control. Luka Milovanov

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

Advanced Computing Tools for Applied Research Chapter 4. Version control

Password Depot for ios

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

TOAD and SubVersion - A Quick How To. Norman Dunbar of Dunbar IT Consultants Ltd.

Avira Management Console User Manual

Introduction to Version Control with Git

Source Code Management/Version Control

A Git Development Environment

A brief introduction to CVS

Integrated version control with Fossil SCM

Introduction to Subversion

Modulo II Software Configuration Management - SCM

Working with Office Applications and ProjectWise

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Introduction. Created by Richard Bell 10/29/2014

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

Flumes Short User Guide to Subversion

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

Source code management systems

Version Uncontrolled! : How to Manage Your Version Control

An Introduction to Collaborating with Version Control

Guide to the Configuration and Use of SFTP Clients for Uploading Digital Treatment Planning Data to IROC RI

NASA Workflow Tool. User Guide. September 29, 2010

HDM-IWE Hotfix Readme

Sophos Mobile Control Super administrator guide. Product version: 3

Transcription:

Version Control Key Points ========================== Mike Jackson, The Software Sustainability Institute. This work is licensed under the Creative Commons Attribution License. Copyright (c) Software Carpentry and The University of Edinburgh 2012. See http://software-carpentry.org/license.html for more information. Derived from Chris Cannam's original at, https://code.soundsoftware.ac.uk/projects/easyhg/wiki/sc2012bootcamppl an... Written in restructuredtext, http://docutils.sourceforge.net/rst.html. Prerequisites ------------- Mercurial, BitBucket. Introduction ------------ Cover VersionControl.ppt, slides 1-2. Use Mercurial command-line. EasyMercurial GUI as a visually appealing alternative - once the concepts are understood. Create a repository directory and add a file -------------------------------------------- hg and Mercury. Set an editor for providing commit messages e.g. nano. export EDITOR=nano Or xemacs export EDITOR=xemacs Or vi. export EDITOR=vi

Create repository. hg init hg status file.txt "?" means repository does not know about it. hg add file.txt hg status file.txt "A" means repository has scheduled it for addition but not yet added it. hg commit file.txt abort: no username supplied message /home/user/.hgrc file contains common settings. [ui] username = Boot Camp <bootcamp@gmail.com> hg commit file.txt Commit message records "why" changes were made. "made a change" messages are redundant. "Commit 1, 2..." messages are redundant. Messages must have meaning to others who may read them (or the original author 6 months from now). hg status file.txt No information means repository knows about it and it's up-to-date..hgignore can record files to ignore e.g. ~ files,.o files,.class files etc. syntax: glob *~ Add to repository. hg add.hgignore

hg commit.hgignore Log, status, difference and revert ---------------------------------- hg log hg status "M" means file has been modified. hg commit hg diff "-" means removed line, "+" means added line. hg revert.orig copy of discarded file. hg update 0 hg update N hg update All commands so far apply to multiple files and directories too. hg diff -r M -r N Alternative to remembering version numbers. hg tag MY_JOURNAL_CODE hg update 0 hg update MY_JOURNAL_CODE Question: we can record our history of changes but we still have a problem, what is it? Answer: no backups! Alternative to using an editor for commit messages. hg commit -m "Fixed overflow bug" file.txt Working by yourself with backups --------------------------------

Manual copy via SSH or copy to DropBox, but revision control systems support remote access. Create a repository in BitBucket: - Log in to http://bitbucket.org/ - Click Create a repository. - Name field: Software Carpentry Boot Camp. - Check Access level: This is a private repository. - Select Repository type: Mercurial. - Click Create repository. - Click Get started. - Click I have code I want to import. Copy "push" URL hg push https://user@bitbucket.org/user/software-carpentry-boot-camp warning: bitbucket.org certificate with fingerprint Mercurial 1.7.3 Mercurial and SSL problem warnings. Either we use an - -insecure flag at the command-line or edit.hgrc. [hostfingerprints] bitbucket.org = 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b Commit commits changes locally, push pushes committed changes to a remote repository. hg push https://user@bitbucket.org/user/software-carpentry-boot-camp Click Source Click Commits rm -rf localrepository hg clone https://user@bitbucket.org/user/software-carpentry-boot-camp cd software-carpentry-boot-camp/ cd.. hg clone https://user@bitbucket.org/user/software-carpentry-boot-camp another-clone hg commit hg push https://user@bitbucket.org/user/software-carpentry-boot-camp cd../software-carpentry-boot-camp hg incoming https://user@bitbucket.org/user/software-carpentry-bootcamp hg pull https://user@bitbucket.org/user/software-carpentry-boot-camp hg log

Find out what version repository is at. hg id -n Check difference to most-up-to-date version and update. hg log hg diff -r M -r N hg update Push changes, pull changes, check for changes - everything needed for collaboration. Working with colleagues ----------------------- Get attendees to pair up into Owner and Partner. Get partner for you too. Owner: - Click BitBucket, cog icon. - Click Access Management. - Enter username of Partner. - Select Write permission. Owner: hg clone https://owner@bitbucket.org/owner/software-carpentry-bootcamp Partner: hg clone https://partner@bitbucket.org/owner/software-carpentry-bootcamp First username is for login, second is repository owner's repository location. Partner: edit file and commit. Owner: check incoming. Question: why are there no incoming changes? Answer: because the changes are only in Partner's local repository. They need to be pushed.

Partner: push. Owner: check incoming, pull, history, update. Partner and Owner: edit file substantially, make sure you both change the same lines. Partner: commit, push. Owner: commit, push. "push creates new remote heads" or "Push failed" warning. Owner: pull, history, hg merge Merged file is marked up with Partner's and Owner's changes. Options: keep Partner's changes and discard Owner's, keep Owner's changes and discard Partner's, manually resolve by editing the file. Owner: hg resolve -m "-m" is "mark resolved" and not "message". Owner: commit and push hg annotate fishstew.txt BitBucket Commits page and tree of changes. Share when completed units of work, small enough to be reviewed within an hour. Quickie practical ----------------- Create a new repository, SoftwareCarpentry. Add shell files to this directory. Push repository to BitBucket. Throughout the rest of the boot-camp keep pushing directories and files there!

Conclusion ---------- Show MAUS's Bazaar code, https://code.launchpad.net/maus/+branches, branches in Bazaar are analogous to clones in Mercurial. Show EasyMercurial. Cover VersionControl.ppt, slide 3 onwards.