CS 390 Software Engineering Lecture 5 More Git

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

A BASIC UNDERSTANDING OF VERSION CONTROL

CS 390 Software Engineering Lecture 4 - Git

Revision control Advanced git

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

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

Introduction to Version Control with Git

Visualizing Git Workflows. A visual guide to 539 workflows

I m an egotistical bastard, and I name all my projects after myself. First Linux, now git. Linus Torvalds, creator of Linux and Git

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

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

Version Control: Gitting Started

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

Version Control Systems

Introduction to distributed version control with git

Introduction to Git and Github

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

Git. Presenter: Haotao (Eric) Lai Contact:

Version Control. Version Control

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

Git for Newbies. ComMouse Dongyue Studio

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

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

Software Development I

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

Version Control. Version Control

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

Mike McQuaid INCLUDES 66 TECHNIQUES. Foreword by Scott Chacon MANNING

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

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

Git tutorial. Katie Osterried C2SM. October 22, 2015

Git for Subversion users

Review Version Control Concepts

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

Tizen/Artik IoT Practice Part 4 Open Source Development

Revision Control. An Introduction Using Git 1/15

GIT Princípy tvorby softvéru, FMFI UK Jana Kostičová,

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

Using git to download and update BOUT++

AIS Grid School 2015

Object Oriented Programming. Week 1 Part 2 Git and egit

Using Git to Manage Source RTL

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

Creating a Patch. Created by Carl Heymann on 2010 Sep 14 1

Use git rm to remove files from workspace

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

CSE 391 Lecture 9. Version control with Git

MOOSE-Based Application Development on GitLab

Version Control with GIT

Online Remote Repositories

Fundamentals of Git 1

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

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

Version control with Git.

Git Branching. Chapter What a Branch Is

Improving Your Life With Git

Advanced Operating Systems Control Versioning with GIT. Giuseppe Massari

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

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

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

Version Control System GIT

Gitting things done. Hands-on introduction to git niceties. Jan Urbański Ducksboard

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

Git for Version Control

FEEG Applied Programming 3 - Version Control and Git II

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

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

Git: Distributed Version Control

RSARTE Git Integration

KTH Royal Institute of Technology SEMINAR 2-29 March Simone Stefani -

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

Introduction to Supercomputing

Git(Lab) Tutorial and Hands-On

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

Github/Git Primer. Tyler Hague

Beyond git add/commit/push

Algorithm Engineering

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

LPF Training Handbook!

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

Version Control System - Git. zswu

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

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

CS314 Software Engineering Configuration Management

E, F. deleteall command, 352 directory structure, 350 export_data method, 353 inline_data method, 353 print_export method, 351 target directory, 351

A brief introduction to the GitLab service at the department

Git version control with Eclipse (EGit) Tutorial

Git. Ľubomír Prda. IT4Innovations.

Software Project (Lecture 4): Git & Github

Lecture 6 Remotes. Sign in on the attendance sheet!

Distributed Version Control (with Git)

Windows. Everywhere else

Git Basi, workflow e concetti avanzati (pt2)

Submitting your Work using GIT

Using GitHub and SourceTree to work with DITA TC repositories

RSARTE Git Integration

Managing Network Configurations with Git and GitLab

Intro to Github. Jessica Young

So#ware(Project. Lecture'4. Wouter'Swierstra. So#ware(project( (Lecture(4 1

Praktische Aspekte der Informatik

Transcription:

CS 390 Software Engineering Lecture 5 More Git Reference: Scott Chacon and Ben Straub, Pro Git, published by Apress, available at https://git-scm.com/book/en/v2.

Outline Finish local repository Remote repository 2

Merging Branches To get a list of branches in the repository, use the branch command without any arguments. $ git branch Generally will want to merge branches back into the master branch. Need to be in the master branch, so check it out if not. $ git checkout master Then merge desired branch $ git merge <branch> If there are no conflicts, git will create a new commit node that has two parents. 3

Merge conflicts A merge conflict occurs when there are changes to a file in both branches. Git will not commit when this happens. For each conflict, git creates a single file with the conflicts from each branch marked. Developer manually edit the file and remove the markers. The modified files must be added and the project committed to make the resolution permanent. 4

Local project workflow Master branch is always a stable, working version. For each new feature or post-release bug fix, check out the master branch, then create a new branch. Or do both at the same time using -b option on check out. $ git checkout -b <branch> Commits of new code go to the branch. When new code passes unit testing, merged it back into the master branch. 5

Remote repository In order to share a git project, need a remote repository on a server. A remote repository usually is a bare repository. I.e., it is just a.git subdirectory without project files. Developers clone a remote repository into a working directory. $ git clone <url> URLs indicate what protocol is used to get the repository. We will be using SSH to access write-all remote repositories (created by instructor) on csserver. $ git clone ssh://[user@]csserver.evansville.edu/usr/local/<project> 6

Remote repository example A practice repository has been set up on csserver $ git clone ssh://[user@]csserver.evansville.edu/usr/local/git/example.git This will ask for a password unless you have set up a public key. See Section 4.3 of Pro Git book. 7

Remote repository In the (local) working directory, refer to the remote repository branch using <remote>/<branch>. The default remote name after cloning is 'origin', so the most common remote branch name is origin/master. Working directory changes are committed to the (local) repository. A clean working directory can be pushed to a remote repository branch. $ git push <remote> <branch> 8

Remote repository Push fails if remote branch has been modified. Requires synchronization. Can be done using fetch, then merge. Fetching does not change the local repository, so can be done at any time to update the remote branch heads. $ git fetch <remote> $ git merge <remote>/<branch> Synchronization can also be done using pull, which is basically fetch and merge in one step for current branch. $ git pull 9

Remote repository example Change to the example working directory Create a file named <username>.txt and write a message in it. Add the file and commit it to the (local) repository. Push changes back to remote repository. If need to synchronize, do so, and try again. 10

Remote repository example Add a line to README file prefixed with username. Add and commit change to (local) repository. Attempt to push changes. If rejected for conflicts, merge with origin/master, remove conflict markers and try again. 11

Workflows Centralized workflow One shared repository that everyone clones and pushes to. Need to coordinate changes so they are compatible Integrated manager workflow The project maintainer pushes to their public repository. A contributor clones that repository and makes changes. The contributor pushes to their own public copy. The contributor requests the maintainer to pull changes. The maintainer adds the contributor s repository as a remote and merges locally. The maintainer pushes merged changes to the main repository. 12

Workflows Dictator and lieutenants workflow Regular developers work on their topic branch and rebase their work on top of master. The master branch is that of the reference repository to which the dictator pushes. Lieutenants merge the developers' topic branches into their master branch. The dictator merges the lieutenants' master branches into the dictator s master branch. Finally, the dictator pushes that master branch to the reference repository so the other developers can rebase on it. 13