Lecture 6 Remotes. Sign in on the attendance sheet!

Similar documents
Midterm Next Week. Last year s midterm (which didn t include remotes):

Sign in on the attendance sheet! Lecture 3 Branches

Git tutorial. Katie Osterried C2SM. October 22, 2015

Git, the magical version control

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

b. Developing multiple versions of a software project in parallel

Visualizing Git Workflows. A visual guide to 539 workflows

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

Git Introduction CS 400. February 11, 2018

AIS Grid School 2015

Revision control. INF5750/ Lecture 2 (Part I)

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

Effective Software Development and Version Control

Software Project (Lecture 4): Git & Github

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

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

Github/Git Primer. Tyler Hague

Version Control with GIT

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

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

Tizen/Artik IoT Practice Part 4 Open Source Development

CS 320 Introduction to Software Engineering Spring February 06, 2017

Object Oriented Programming. Week 1 Part 2 Git and egit

Git. Presenter: Haotao (Eric) Lai Contact:

Git for Subversion users

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

Software Development I

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

Laboratorio di Programmazione. Prof. Marco Bertini

FEEG Applied Programming 3 - Version Control and Git II

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

Version Control: Gitting Started

CS 390 Software Engineering Lecture 5 More Git

CS314 Software Engineering Configuration Management

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

git and the virtue of version control ECE /2/2015

A BASIC UNDERSTANDING OF VERSION CONTROL

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

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

Version Control System GIT

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

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

Using Git and GitLab: Your first steps. Maurício

How to git with proper etiquette

A L A TEX-oriented intro to Git

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

Git for Version Control

Using GitHub and SourceTree to work with DITA TC repositories

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

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

Software Engineering

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

Version Control. Version Control

Version Control. Version Control

Git: Distributed Version Control

Introduction to Git and Github

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

Lab Objective. Lab Assignment. Downloads and Installation

Fundamentals of Git 1

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:

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

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

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

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

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

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

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

Use git rm to remove files from workspace

Git: Distributed Version Control

Revision Control. An Introduction Using Git 1/15

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

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 Systems (Part 1)

Tips on how to set up a GitHub account:

Version Control. Collaborating with git. Tim Frasier

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.

Version Control Systems: Overview

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

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

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

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

Intro to Github. Jessica Young

Git: (Distributed) Version Control

Version Control Systems (VCS)

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

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

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


Version control CSE 403

Git. Ľubomír Prda. IT4Innovations.

Version Control System - Git. zswu

Assumptions. GIT Commands. OS Commands

Lab 08. Command Line and Git

Improving Your Life With Git

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Introduction to Version Control

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

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

Revision Control and GIT

Transcription:

Lecture 6 Remotes Sign in on the attendance sheet!

Midterm Review Everyone did great!

What We ve Learned So Far Creating and cloning repositories git init, git clone Linear commit histories and diffs git log, git show, git diff Using the working directory and staging area and making commits git add, git reset, git checkout, git commit Using branches git branch, git checkout, git merge How git s model for commit histories works

Today Remotes git remote git fetch git pull git push Github

Last Time: Branches featurea, HEAD db82ca7: Merge branch featurea into db82ca7: Merge branch featurea into b5f3729: Alice: even more work on feature A featureb 8277e09: Bob: even more work on feature B 6f96cf3: Alice: more work on feature A e167179: Bob: more work on feature B : Alice: begin work on feature A b4e2c29: initial commit 8b7d883: Bob: begin work on feature B

From the First Lecture: Git is a DVCS HEAD HEAD mybranch 59a 324 aa2 c35 push, pull, fetch mybranch 59a 324 aa2 c35 53a cfb 53a cfb Alice s Repo HEAD mybranch 59a 324 aa2 c35 Bob s Repo 53a cfb Charlie s Repo

Scenario: Alice and Bob are writing a story about squirrels Fetch Request Fetch Response alice-repo/ b4e2c29 Finish chapter 1 b4e2c29 Finish chapter 1 Alice Bob

Fetch Response parent: b4e2c29 points to: alice-repo/ b4e2c29 Finish chapter 1 b4e2c29 Finish chapter 1 Alice Bob

Fetching 1. Tell git to set up Alice s repository as a remote repository or a remote. This only happens once. 2. Tell git to download the commits and branch pointers that you don t have from the remote repository

STEP 1 git remote add <remotename> <remoteurl> Example use: git remote add origin https://github.com/aperley/squirrel-story.git Adds a remote repository called origin located at https://github.com/aperley/squirrel-story.git origin is the default name for a remote, since often times the first remote you have is the one you clone from If you created the repository using git clone (rather than git init), the repository you cloned from is called origin

STEP 2 git fetch <remotename> Example use: git fetch origin Downloads and updates all branches published by the remote Stores these branches as <remotename>/<branchname> Does NOT affect your own branches, like!

Listing Remote Branches git branch r (only remote) or git branch a (all branches)

You can checkout remote branches But you can t make commits on them or move them like normal! Because they represent the state of the remote repository and are changed by git fetch!

How do you actually bring in the remote changes? parent: b4e2c29 points to: b4e2c29 Finish chapter 1 b4e2c29 Finish chapter 1 Alice Bob

How do you actually *merge* in the remote changes? git fetch alice-repo git checkout b git merge alice-repo/ Everything is a branch! alice-repo/ b4e2c29 Finish chapter 1 Alice HEAD b4e2c29 Finish chapter 1 Bob

git pull <remotename> Example use: git pull origin Runs git fetch <remotename>, then git merge <remotename>/<currentbranch> Ex: runs git fetch origin, then git merge origin/

What about giving back? git push alice-repo : HEAD 9a81d3e Add chapter 2 edits 9a81d3e Add chapter 2 edits alice-repo/ b4e2c29 Finish chapter 1 Alice b4e2c29 Finish chapter 1 Bob

git push git push <remote_name> <local_branch>:<remote_branch> Uploads the necessary commits to <remote_name> and changes <remote_name>/<remote_branch> to point to the same commit <local_branch> points to.

Summary Configuring remotes: git remote [-v] lists remotes [verbosely] git remote add <remotename> <remoteurl> - configure a new remote git branch r or a lists branches including remote tracking Fetching: git fetch <remotename> - downloads updates to all remote-tracking branches to match the remote git pull <remotename> - runs `git fetch`, then merges in updates to the current branch Pushing: git push <remotename> <branchname> - uploads changes in your branches to the remote

Activity! Clone: YOUR_ANDREW_ID@unix.andrew.cmu.edu:/afs/andrew.cmu.e du/course/98/174/public/lecture6-practice Create a branch named YOUR_ANDREW_ID And make a commit to it Push the branch up to origin