Introduction to Git and Github Repositories

Similar documents
Introduction to Monte Python

Git & Github Fundamental by Rajesh Kumar.

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

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

Using git to download and update BOUT++

Git for Subversion users

Software Development I

Visualizing Git Workflows. A visual guide to 539 workflows

The Old World. Have you ever had to collaborate on a project by

Tizen/Artik IoT Practice Part 4 Open Source Development

Version control. what is version control? setting up Git simple command-line usage Git basics

Version Control with Git ME 461 Fall 2018

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

A BASIC UNDERSTANDING OF VERSION CONTROL

Git: Distributed Version Control

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

CS314 Software Engineering Configuration Management

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

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

Intro to Github. Jessica Young

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

AIS Grid School 2015

Git: Distributed Version Control

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

Effective Software Development and Version Control

Git Introduction CS 400. February 11, 2018

Git, the magical version control

Basics of Git GitHub

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

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

Tips on how to set up a GitHub account:

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Object Oriented Programming. Week 1 Part 2 Git and egit

Revision Control. An Introduction Using Git 1/15

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

Version Control: Gitting Started

Git tutorial. Katie Osterried C2SM. October 22, 2015

Revision Control and GIT

INET

Version Control with Git

Github/Git Primer. Tyler Hague


Git. Ľubomír Prda. IT4Innovations.

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

Esri on GitHub: How to Participate in Open Source Projects

Version control system (VCS)

Python Project Example Documentation

Git Basi, workflow e concetti avanzati (pt2)

TangeloHub Documentation

Software Project (Lecture 4): Git & Github

Using GitHub to Share with SparkFun a

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

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

Version Control Systems (VCS)

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Having Fun with Social Coding. Sean Handley. February 25, 2010

School of Computing Science Gitlab Platform - User Notes

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

FPLLL. Contributing. Martin R. Albrecht 2017/07/06

Distributed Version Control

chatterbot-weather Documentation

How to version control like a pro: a roadmap to your reproducible & collaborative research

February 2 nd Jean Parpaillon

Building CircuitPython

Index. Alias syntax, 31 Author and commit attributes, 334

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

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

Introduction to Git and Github

Using GitHub and SourceTree to work with DITA TC repositories

How to be a git. Dominic Mitchell

2 Initialize a git repository on your machine, add a README file, commit and push

Lab Exercise Git: A distributed version control system

Django MFA Documentation

Version Control. Version Control

F17 Modern Version Control with Git. Aaron Perley

Version control with Git.

Version Control Systems (Part 1)

git-flow Documentation

Recap: Developer's Environment

Tizen Project Guideline. SKKU Embedded Software Lab.

TDDC88 Lab 4 Software Configuration Management

Poulpe Documentation. Release Edouard Klein

TPS Documentation. Release Thomas Roten

doconv Documentation Release Jacob Mourelos

Improving Your Life With Git

FEEG Applied Programming 3 - Version Control and Git II

S18 Modern Version Control with Git

Roman Numeral Converter Documentation

Game Server Manager Documentation

Source Code Management wih git

Online Remote Repositories

Belle II - Git migration

Contributing to Insoshi with Git and GitHub. Michael Hartl

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

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

A Practical Introduction to Version Control Systems

Overview. during this tutorial we will examine how touse git from the command line. finally we will explore a graphical visualisation of git activity

Transcription:

Introduction to Git and Github Repositories Benjamin Audren École Polytechnique Fédérale de Lausanne 29/10/2014 Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 1 / 16

Version Control survey Survey Who uses it daily/weekly? Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 2 / 16

Version Control survey Survey Who uses it daily/weekly? svn, git, mercurial? Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 2 / 16

Version Control Goals Benefits keep track of modifications in case of bugs clear history, to roll back to an old but stable version allowing collaboration backing up a project Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 3 / 16

Two paradigms Centralised Version Control history lives only in one place. need server communication to commit a change. branching gives headache. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 4 / 16

Two paradigms Centralised Version Control history lives only in one place. need server communication to commit a change. branching gives headache. Distributed Version Control virus-like way of storing the history. no internet required to work. powerful branch system. problems may appear when editing the same file. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 4 / 16

Git Characteristics Distributed version control, with remote repository. Used for the development of the Linux kernel. Has a huge community, with Github. Cool features to share the code online. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 5 / 16

Installation Unix sudo apt-get install git Mac http://git-scm.com/download/mac or with Brew/Mac Ports: sudo port install git-core +svn +doc Windows Install a VirtualBox with Ubuntu, please! Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 6 / 16

Basic Usage Exercice Example mkdir example, cd example Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. touch README.md, then edit it. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. touch README.md, then edit it. git status check the status of the folder. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. touch README.md, then edit it. git status check the status of the folder. git add README.md put in the staging area. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. touch README.md, then edit it. git status check the status of the folder. git add README.md put in the staging area. git commit -m first commit Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Basic Usage Exercice Example mkdir example, cd example git init This creates an empty git repo. touch README.md, then edit it. git status check the status of the folder. git add README.md put in the staging area. git commit -m first commit git log --graph or use gitk Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 7 / 16

Staging Area Concept local modifications to be commited to the history: HEAD Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 8 / 16

Staging Area Concept local modifications to be commited to the history: HEAD It can be several files that constitutes more than one logical commit! Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 8 / 16

Staging Area Concept local modifications to be commited to the history: HEAD It can be several files that constitutes more than one logical commit! git add selects which files to commit, and put them in the staging area. Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 8 / 16

Staging Area Concept local modifications to be commited to the history: HEAD It can be several files that constitutes more than one logical commit! git add selects which files to commit, and put them in the staging area. git commit -m first commit Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 8 / 16

Branching Easy as pie git branch list all existing branches (master) git branch modif create the branch modif git checkout modif switch to the branch modif touch toto.py, edit the file git add, commit git log --graph modif git checkout master git merge modif --no-ff Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 9 / 16

Branching Exercise Different merging strategies What did the --no-ff do? What happens if you omit it? Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 10 / 16

Remote Repositories Adding a remote from an existing repo git remote add origin https://github.com/you/yourcode.git git pull origin master git push origin master Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 11 / 16

Remote Repositories Adding a remote from an existing repo git remote add origin https://github.com/you/yourcode.git git pull origin master git push origin master Cloning an existing repo git clone https://github.com/lesgourg/class_public.git cd class_public touch, add, commit Warning: you can not push this! Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 11 / 16

Github Most important for end-users The https://github.com/baudren/montepython_public/issues page Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 12 / 16

Forking on Github Forking To clone a public repository and modify it. You have the rights to commit changes to your fork. Send a Pull-Request to us via Github. Note that your fork will be public. You can request an academic account https://github.com/blog/1840-improving-github-for-science Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 13 / 16

For reference Branching model Essentially follows http://nvie.com/posts/a-successful-git-branching-model/ Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 14 / 16

For reference master v2.4.0 v2.4.1 v2.4.2 v2.5.0 devel release-2.4 release-2.5 feature Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 15 / 16

For reference master v2.4.0 v2.4.1 v2.4.2 v2.5.0 devel release-2.4 release-2.5 feature Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 15 / 16

For reference master v2.4.0 v2.4.1 v2.4.2 v2.5.0 devel release-2.4 release-2.5 feature Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 15 / 16

Modifying locally a public repository Exercise I clone class copy over your modified files from (η b or σ 8 ) git status git add, commit Exercise II Fork the repository to commit your own modifications read https://github.com/lesgourg/class_public/wiki/public-contributing Exercise III Open an issue to request a missing feature or declare a bug Benjamin Audren (EPFL) CLASS/MP MP runs 29/10/2014 16 / 16