Use git rm to remove files from workspace

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

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

Github/Git Primer. Tyler Hague

How To Use Git. Advanced: Tags & Branches. Mary Kate Trost July 8, 2011

Tizen/Artik IoT Practice Part 4 Open Source Development

Git, the magical version control

Git tutorial. Katie Osterried C2SM. October 22, 2015

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

Git. Presenter: Haotao (Eric) Lai Contact:

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

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

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

A BASIC UNDERSTANDING OF VERSION CONTROL

CS 390 Software Engineering Lecture 5 More Git

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

Introduction to Git and Github

CS314 Software Engineering Configuration Management

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:

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

Software Engineering

Beyond git add/commit/push

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

Git for Newbies. ComMouse Dongyue Studio

Review Version Control Concepts

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

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

AIS Grid School 2015

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

Git Introduction CS 400. February 11, 2018

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

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

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

b. Developing multiple versions of a software project in parallel

Software Development I

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

Windows. Everywhere else

Git(Lab) Tutorial and Hands-On

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

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

Version Control System - Git. zswu

Tools for software development:

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

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

Lab 08. Command Line and Git

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

RSARTE Git Integration

Version Control: Gitting Started

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

Revision control. INF5750/ Lecture 2 (Part I)

Visualizing Git Workflows. A visual guide to 539 workflows

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

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

Version Control. Version Control

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

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

Revision Control and GIT

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

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

Git for Version Control

GIT for companies Mark Struberg, INSO TU Vienna

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

Revision control Advanced git

Version control with Git.

Lecture 6 Remotes. Sign in on the attendance sheet!

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

Why To Go With Licensed Version Control Tool When Open Source Tool Is There

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

Software Project (Lecture 4): Git & Github

Managing Network Configurations with Git and GitLab

Algorithm Engineering

CSC 2700: Scientific Computing

Version Control. Version Control

A L A TEX-oriented intro to Git

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

Git version control with Eclipse (EGit) Tutorial

Lab Objective. Lab Assignment. Downloads and Installation

Eugene, Niko, Matt, and Oliver

Using GitHub and SourceTree to work with DITA TC repositories

Version Control Systems

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

How to be a git. Dominic Mitchell

Object Oriented Programming. Week 1 Part 2 Git and egit

Version Control System GIT


Assumptions. GIT Commands. OS Commands

Git for Subversion users

Praktische Aspekte der Informatik

RSARTE Git Integration

Tutorial 2 GitHub Tutorial

Fundamentals of Git 1

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

699DR git/github Tutorial

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

Improving Your Life With Git

Introduction to distributed version control with git

Using Git to Manage Source RTL

Distributed Version Control Git

Git Memento. Author: Jérémie DECOCK Contact: Revision: 0.1 Date: 20/05/2016 License: Creative Commons 4.0 (CC BY-SA 4.

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

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

Transcription:

More Git: Removing files from the repository Branches, tags, merge conflicts Pull requests CPSC 491 First: Get up to speed from last time Removing files from your workspace Use git rm to remove files from workspace e.g., to get rid of unneeded files when you push to origin/master, removes file there as well How to run: git rm FILE

Exercise 9: Add and remove a file 1. create a new file called YOURNAME-tmp.txt 2. add it to your workspace & push to origin/master 3. remove the file from your workspace 4. update and then push change Creating a branch You create a branch using git branch BNAME will want to branch from an update-to-date branch e.g., after pulling origin/master You switch to the branch using git checkout BNAME this sets your current workspace to the branch can switch back and forth between branches How to run: git branch BNAME git checkout BNAME Alternatively: git checkout -b BNAME

Exercise 10: Create a branch 1. create a new branch named YOURNAME-branch 2. create, add, and commit a file to the branch named YOURNAME-file-2.txt 3. switch to the master branch 4. what changed in your working directory (e.g., run ls)? Merging branches When you are in a branch, you can merge in another branch e.g., to update your branch, merge master into it or, switch to master, merge in your branch adds new files, merges changes to existing files Use the git merge BNAME to merge in changes How to run (e.g., from your new branch): git merge master -m message git merge origin/master -m message

Exercise 11: merge a branch 1. switch to master (git checkout master) 2. create, add, and commit a file to the branch named YOURNAME-file-3.txt 3. switch to your branch 4. merge in master (git merge master -m... ) 5. what changed in your branch? 6. switch back to master and push your changes... Pushing your new branch So far, you only have your branch in your workspace Now we want to push it to the mothership e.g., so that others can work on it and so it is versioned in the central repository To push it (from within the branch), run: git push --set-upstream origin BNAME

Exercise 12: push your branch 1. switch to your branch 2. push your branch 3. see if you can find your branch on GitHub To remove a branch Once you are done with a branch you can delete it either locally or from the repository To remove a branch locally run (from master): git branch -d BNAME To remove a branch from repository run (from master): git push origin --delete BNAME

Creating Tags Git supports 2 kinds of tags: lightweight vs annotated an annotated tag has additional information including a message and info on who created the tag To see the existing tags: git tag To create an annotated tag: git tag -a TAGNAME -m tag message To see information about a tag: git show TAGNAME Exercise 13: tag your branch 1. switch to your branch 2. create a tag with tag name v0.1 3. verify that the tag was created and show the tag info

Pushing Tags to the Shared Server By default, git push doesn t push tag information instead, have to tell git to push the tag To push a tag: git push origin TAGNAME To branch form a tag: git checkout -b BRANCHNAME TAGNAME This only creates a branch, tagged configurations don t change Exercise 14: push your tag 1. push your tag to origin 2. go onto GitHub 3. select branch & look at releases (should see your branch)

Merge Conflicts Usually git can auto-merge just fine But sometimes there is a problem when it can t merge a conflict, it pauses the merge process and then you have to fix the conflict yourself You can run a mergetool to help fix the merge: git mergetool Once the merge is resolved, start the process again git status will tell you what to do Exercise 15: resolve a conflict 1. switch to your branch 2. add Hello World! to the end of YOURNAME.txt 3. commit the file 4. switch to master 5. add Hellooo Wooorld!!! to the end of YOURNAME.txt 6. commit the file 7. switch to your branch and merge in master 8. fix the merge and commit 9. what happens to master?

Pull Requests A feature of GitHub... request for a branch to be pulled into master UI for carrying out this process Try it out: 1. make sure your branch is pushed 2. log on to GitHub, select your branch 3. click on the pull request button 4. walk through the steps of performing a pull request Where to find out more... The Git book: https://git-scm.com https://git-scm.com/book The GitHub documentation https://help.github.com