Using git to download and update BOUT++

Similar documents
Computer Science Design I Version Control with Git

Version Control Systems

Overview. 1. Install git and create a Github account 2. What is git? 3. How does git work? 4. What is GitHub? 5. Quick example using git and GitHub

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

CS 390 Software Engineering Lecture 4 - Git

Version Control with GIT

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

A BASIC UNDERSTANDING OF VERSION CONTROL

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Version Control: Gitting Started

CS 390 Software Engineering Lecture 5 More Git

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Version control with Git.

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Git for Version Control

Introduction to Git and Github Repositories

Software Development I

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

Fundamentals of Git 1

Revision control. INF5750/ Lecture 2 (Part I)

Version Control Systems. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Version Control with GIT: an introduction

License. Introduction to Version Control with Git. Local Version Control Systems. Why Use Version Control?

CSE 391 Lecture 9. Version control with Git

Tools for software development:

Intro to Github. Jessica Young

Git Setup Help using GitKraken (CSE 154)

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

Version Control for Fun and Profit

Laboratorio di Programmazione. Prof. Marco Bertini

Algorithm Engineering

Introduction to Version Control with Git

Distributed Version Control

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Git. Presenter: Haotao (Eric) Lai Contact:

Using Git For Development. Shantanu Pavgi, UAB IT Research Computing

Version Control with Git ME 461 Fall 2018

Revision control Advanced git


Software Project (Lecture 4): Git & Github

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

Online Remote Repositories

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Introduction to Version Control

Working with GIT. Florido Paganelli Lund University MNXB Florido Paganelli MNXB Working with git 1/47

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

! #Running this command from the top directory of your project will add all your changes."! $ git add."

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Git. all meaningful operations can be expressed in terms of the rebase command. -Linus Torvalds, 2015

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Lab 08. Command Line and Git

Version Control with Git

AIS Grid School 2015

Git, the magical version control

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

Introduction to distributed version control with git

Version control CSE 403

LAB MANUAL GIT BY PRATIK JAIN. To start with git bash, we need to authenticate ourselves so that for every commit, git can use this information.

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

How to be a 1337 h4ck3r: Git + Linux

A Practical Introduction to Version Control Systems

Using GitHub to Share with SparkFun a

Software Revision Control for MASS. Git Basics, Best Practices

Version Control Systems (Part 1)

Object Oriented Programming. Week 1 Part 2 Git and egit

S18 Modern Version Control with Git

CSE 331 Software Design & Implementation

Version Control Systems

CS 378: Autonomous Intelligent Robotics (FRI) Dr. Todd Hester

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

Git. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

Version control CSE 403

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

Submitting your Work using GIT

Software Revision Control for MASS. Git Installation / Configuration / Use

What is Git? What is Git? Version Control. Barry Grant

Revision Control and GIT

Welcome! Virtual tutorial will start at 15:00 GMT. Please leave feedback afterwards at:

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Push up your code next generation version control with (E)Git

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to

Git for Newbies. ComMouse Dongyue Studio

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Version Control with Git

INET

F17 Modern Version Control with Git. Aaron Perley

Introduction to Monte Python

Transcription:

ER Meeting 14th Sept 2015 1/28 Using git to download and update BOUT++ Peter Hill

ER Meeting 14th Sept 2015 2/28 Outline What is git? Getting git Basic git usage Getting BOUT++ Compiling BOUT++ Running examples Contributing to BOUT++

ER Meeting 14th Sept 2015 3/28 What is git? Version Control System (VCS) Version control systems record changes to a file/set of files over time Not just software! This talk is under git Allows you revert files back to a previous state, compare changes over time, see who last modified something, etc. Local VCS Naive versioning: separate folders for each version Slightly better: local database of changes

ER Meeting 14th Sept 2015 4/28 What is git? Centralised vs Distributed VCS Centralised VCSs: CVS, Subversion Have a single server than contains all the versioned files Can see what other people are working on Easier to administer a centralised VCS than local databases on each client If server goes down, can lose access to project history, etc. If central database is lost, everything not backed-up is lost Distributed VCSs: git, mercurial Clients don t just checkout latest snapshot of files, repository is fully mirrored If server goes down, any client repo can be copied back to server to restore it Multiple remote repos work pretty well

ER Meeting 14th Sept 2015 5/28 How does it work? Snapshots git thinks of its data like a set of snapshots of a miniature filesystem. Every time you commit, it takes a picture of what all your files look like and stores a reference to that snapshot

ER Meeting 14th Sept 2015 6/28 git is local Vast majority of operations are local Doesn t need to talk to remote servers to get e.g. history This means you can continue to work offline, including committing changes to the database Checking out a copy of the repository means you have a full copy You can copy your local version onto a USB stick and hand it to someone They now have access to the project history, can make changes, etc.

ER Meeting 14th Sept 2015 7/28 git has integrity Everything in git is check-summed References are to checksums git can immediately detect if data gets lost in transit or files are corrupted Checksums are done using SHA-1: 24b9da6552252987aa493b52f8696cd6d3b00373 git stores everything, not by name, but by hash value of its contents

ER Meeting 14th Sept 2015 8/28 The Three States Important to understand correctly Three main states that files can be in: 1 Committed: data stored in repo 2 Modified: file is changed but not committed 3 Staged: modified file marked to go into next commit

ER Meeting 14th Sept 2015 9/28 Getting git Linux Get git through your package manager: sudo yum install git sudo apt-get install git sudo zypper install git Mac Install Xcode Command Line Tools, then try to run git. If you don t have it installed already, it will prompt you to install it. More up-to-date version: http://git-scm.com/download/mac Alternatively, use GitHub for Mac: http://mac.github.com

ER Meeting 14th Sept 2015 10/28 Getting git Windows Official build: http://git-scm.com/download/win Note that this is actually Git for Windows Alternatively, use GitHub for Windows: http://windows.github.com From source Download tarball from either https://github.com/git/git/releases or https://www.kernel.org/pub/software/scm/git Compile and install, then you can get git via git!

ER Meeting 14th Sept 2015 11/28 Getting a repo Two choices: import an existing project into git, or clone an existing git repo from somewhere else Initialise a repository Go to project s directory: git init Creates a new subdirectory names.git containing all the necessary repo files Nothing in project is tracked yet

ER Meeting 14th Sept 2015 12/28 Cloning an existing repository # Clones into./bout-dev git clone https://github.com/boutproject/bout-dev.git # Clones into./bout++ git clone https://github.com/boutproject/bout-dev.git BOUT++ Doesn t just get a working copy - git receives a full copy of nearly all data that the server has This used the HTTPS protocol, but you can also use SSH like user@server:path/to/repo.git To use SSH on GitHub, add your (public!) SSH key to your GitHub profile

Lifecycle of a file ER Meeting 14th Sept 2015 13/28

ER Meeting 14th Sept 2015 14/28 Getting help git help <command> git <command> --help git <command> -h man git-<command>

ER Meeting 14th Sept 2015 15/28 Checking status git status git status -s

ER Meeting 14th Sept 2015 16/28 Tracking new files git add <filename> git add *.cxx

ER Meeting 14th Sept 2015 17/28 Staging modified files git add <changed file>

ER Meeting 14th Sept 2015 18/28 Ignoring files.gitignore

ER Meeting 14th Sept 2015 19/28 Viewing changes git diff git diff --staged git diff <filename> git difftool --tool=meld

ER Meeting 14th Sept 2015 20/28 Committing changes git commit git commit -m "Useful commit message" git commit -a -m "This commits everything"

ER Meeting 14th Sept 2015 21/28 Removing files git rm <filename> Doesn t delete file! Just removes it from git repo

ER Meeting 14th Sept 2015 22/28 Moving files git mv <old file> <new file> This is synonym for mv <old file> <new file> git rm <old file> git add <new file>

ER Meeting 14th Sept 2015 23/28 Viewing project history git log Huge amount of options here Add to your.gitconfig

ER Meeting 14th Sept 2015 24/28 Getting BOUT++ Use git to clone the repository: # Clones into./bout-dev git clone https://github.com/boutproject/bout-dev.git # Clones into./bout++ git clone https://github.com/boutproject/bout-dev.git BOUT++

ER Meeting 14th Sept 2015 25/28 Compiling BOUT++ Basic configure and make:./configure --with-lapack --with-netcdf make Then check examples work: cd./examples./test_suite_make./test_suite

ER Meeting 14th Sept 2015 26/28 Submitting a bug report Open an issue on GitHub

ER Meeting 14th Sept 2015 27/28 Contributing to BOUT++ 1 Create a new branch git branch my-new-feature git checkout my-new-feature 2 Make changes 3 Run test suite if necessary 4 Commit (with a nice message!) git add README.md git commit -m "Fiddle with contributing section in README" 5 Push to GitHub git push 6 Submit pull request

ER Meeting 14th Sept 2015 28/28 Acknowledgments Some material from Pro Git, Second Edition by written by Scott Chacon and Ben Straub and published by Apress. Available here: https://git-scm.com/book Licensed under Creative Commons Attribution Non-Commercial Share Alike 3.0 Licence.