Object Oriented Programming. Week 1 Part 2 Git and egit

Similar documents
CS314 Software Engineering Configuration Management

Software Development I

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

Git Introduction CS 400. February 11, 2018

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

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

CS 390 Software Engineering Lecture 5 More Git

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

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

Revision control. INF5750/ Lecture 2 (Part I)

Lab Exercise Git: A distributed version control system

#25. Use Source Control in a Single- Developer Environment

Version Control Systems

Version Control System GIT

CS 320 Introduction to Software Engineering Spring February 06, 2017

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

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

Git, the magical version control

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

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

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

A short tutorial on Git. Servesh Muralidharan 4 March 2014

Lecture 6 Remotes. Sign in on the attendance sheet!

Tizen/Artik IoT Practice Part 4 Open Source Development

Lab Exercise 1 Using EGit and JUnit

CS 390 Software Engineering Lecture 3 Configuration Management

Tips on how to set up a GitHub account:

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


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

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

b. Developing multiple versions of a software project in parallel

Table of Contents. Concepts

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

Lesson 7: Recipe Display Application Setup Workspace

Git tutorial. Katie Osterried C2SM. October 22, 2015

EGit/Gerrit Hands-on training #1: Installation and Configuration

Tools for software development:

CSE 332: Data Structures and Parallelism Winter 2019 Setting Up Your CSE 332 Environment

Version Control. Version Control

Git version control with Eclipse (EGit) Tutorial

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

Visualizing Git Workflows. A visual guide to 539 workflows

FEEG Applied Programming 3 - Version Control and Git II

Code Repository. P Blanchfield

USER GUIDE MADCAP LINGO Source Control: Git

Submitting your Work using GIT

Lab Objective. Lab Assignment. Downloads and Installation

Gitlab Setup/Usage by Yifeng Zhu modified by Vince Weaver 30 January 2019

:59:32 PM PST

Software Project (Lecture 4): Git & Github

TDDC88 Lab 4 Software Configuration Management

Windows. Everywhere else

Version Control with Git ME 461 Fall 2018

(Cloud9) and to the Remote Repository (GitHub)

Django MFA Documentation

Fundamentals of Git 1

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

Software Engineering

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

Produced by. App Development & Modelling. Eamonn de Leastar

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

AIS Grid School 2015

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

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:

A BASIC UNDERSTANDING OF VERSION CONTROL

Github/Git Primer. Tyler Hague

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

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


EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

RSARTE Git Integration

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

Review Version Control Concepts

Git for Subversion users

Getting the Source Code

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

CSE 391 Lecture 9. Version control with Git

Git & Github Fundamental by Rajesh Kumar.

Version Control. Version Control

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

Managing Network Configurations with Git and GitLab

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

Effective Software Development and Version Control

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

Using Git to Manage Source RTL

Introduction to Git and Github Repositories

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

MOOSE-Based Application Development on GitLab

History...: Displays a window of Gitk, a standard commit viewer for Git.

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

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

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

Git(Lab) Tutorial and Hands-On

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

CSCE UVM Hands-on Session-1 Pre-Work

Setting up GitHub Version Control with Qt Creator*

Using git to download and update BOUT++

Version Control with GIT

Transcription:

Object Oriented Programming Part 2 Git and egit

Lecture Review of Git Local Repository Remote Repository Using Git from Eclipse

Review of Git 3

What is Git? Software Configuration Management (SCM) Supports rollback, returning software to an earlier state So errors can be removed So requirements can be dropped So experiments can be done 4

SCM and Backup SCM is not backup. Unless the copies are also copied to a remote disk, all versions can be lost. But copying to remote disks make produce incompatible versions Git supports both SCM and Backup Remote versions are copies of local versions Versions are named according to their contents Files with the same content have the same name 5

Local Repository 6

Local Repositories: SCM only Each repository contains all previous versions of the program. Losing the repository means losing all previous versions Local Repositories are useful when: You accidentally overwrite a file You cannot figure out why your program no longer works You want to know who broke the program 7

Checking in to a Local Repository Create a repository (git init) One time per program. Each time you change your program, check in to create a new version 1)Tell Git what you added to the program (git add) 2)Tell Git that to create a new versions (git commit) 8

Git check in Workspace 1. git add File 1 (mod) File 2 Trash Index File 1 (mod) 2. git commit New Head Head Current-1 Current-2 Current-3 Local Workstation 9

a Local Repository Find the version you want (git log) Retrieve the version you want (git checkout) Puts the specified version in a working directory You can look at the old version, copy from the old version, even check in the old version as the newest version. Usually if you want to save the old version, check it out into a new branch (git checkout -b new_branch_name) To get the most recent version (git checkout master) 10

Git check out Workspace File 1 1. git log Head 2. git checkout Current-1 Current-2 Current-3 Current-4 Local Workstation 11

Remote Repository 12

What is a remote repository? A remote repository is a copy of versions of a program stored on a remote host. A host computer runs a program such as an SCM repository If the local host fails, the repository survives on the remote host Users pull a version from the remote repository Users push a version to the repository to keep it safe 13

Git repository strategy Git differs from most repository in that all Git repositories hold the same content Most SCM system have a central repository. Only one version is stored locally at a time. Git stores all versions both locally and remotely Checking in and checking out merges differences 14

Remote Repository Set Up To set up a remote repository, you need access to both the remote computer and the local computer. On the remote computer you create a Git repository with nothing in it (git init bare) On the local computer you tell git where the remote computer is (git remote add origin <user>@<remote.host>:<git repo>) 15

Push To use the remote repository, you push your files to the remote repository (git push origin master) Copies all changes to the remote repository When pushing, Git compares the files in the local and remote repositories and makes you reconcile them Only when they are the same can you push them 16

Git push Workspace Head Current-1 Current-2 1. Compare versions 2. Resolve differences 3.Store new version New Head Current-3 Head Current-1 Current-2 Current-3 Local Workstation Remote Host 17

Pull To retrieve the files you pull from the repository You can also clone a remote repository which will create a new version with all existing versions There are two ways to pull You can create a new local repository by cloning the remote repository (git clone <user>@<remote host>:<directory on remote host> You can copy the directory into an existing local git repository after the repository is set up (git pull origin master) If you pull to an existing repository, git will make you reconcile the files. 18

Git pull Workspace Head Current-1 Current-2 1. Compare versions 2. Resolve differences 3.Copy the remote Head Current-1 Current-2 Current-3 Current-3 Current-3 Current-4 Local Workstation Remote Host 19

Git Local Repository from Eclipse 20

Set up Local Repository 1. Right Click on project 2. Select Team > Share Project 21

Set up Local Repository 1. Right Click on project 2. Select Team > Share Project 22

Specify Repository location 1.Click Create 23

Choose directory 1. Choose a directory Should not be in working directory a. Select Browse b. Create a new folder c. Select that folder as your git directory 24

Project now managed in Git Project how marked with > 25

Add Content Now marked with? Files not checked in 26

Add to Index Team > Add to Index 27

Added to Index Files are Stages 28

Commit 29

Add Commit Message 30

Git Remote Repository from Eclipse 31

Log in to the AWS server ssh <username>@<host> Enter password Prompt from remote host Username: given to you in class Hostname: ec2-52-76-42-81.ap-southeast-1.compute.amazonaws.com Host IP: 52.76.42.81 Password: given to you in class 32

Change password if first login passwd Old password New password Repeat new password Write down your new password 33

Create a remote Git repository In home directory Create a Git directory Enter to the Git directory Initialize the remote repository Git directory contains empty repo 34

Choose Push Branch 'master' 35

Set Pointer to Remote Host Host Name Git Directory on host Remote User Remote User Password 36

Push Acknowledged 37

Clone Remote Repository from Eclipse 38

Import a project from Git From the file menu Choose Import... 39

Select Projects from Git 40

Select Clone URI Clone URI will let you download a project that is stored on a remote host. The URI represents the host and the directory that contains the Git repository. You will download it into a new Git repository. 41

Enter the URI Enter the URI here: It will be parsed into other fields The password for git goes here 42

Select Branch Select master Click Next > 43

Indicate the local repository Local Repository Path 44

Select Project Select general project 45

Give the project a name Demo4 46

Project Added Demo4 47