Git CS 110 - Fall 2018.

Slides:



Advertisements
Similar presentations
Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Advertisements

Version Control Systems Phil Pratt-Szeliga Fall 2010.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Getting Started with GIT. Basic Navigation cd means change directory cd.. moves you up a level cd dir_name moves you to the folder named dir_name A dot.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
With Mercurial and Progress.   Introduction  What is version control ?  Why use version control ?  Centralised vs. Distributed  Why Mercurial ?
Git – versioning and managing your software L. Grewe.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Source Control Primer Patrick Cozzi University of Pennsylvania CIS Spring 2012.
Version Control. How do you share code? Discussion.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
1 GIT NOUN \’GIT\ A DISTRIBUTED REVISION CONTROL AND SOURCE CODE MANAGEMENT (SCM) SYSTEM WITH AN EMPHASIS ON SPEED. INITIALLY DESIGNED AND DEVELOPED BY.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Dr. Tanusri Bhattacharya
Version Control Systems
Source Code Control For CSE 3902 By: Matt Boggus.
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
4 Version control (part 1)
Information Systems and Network Engineering Laboratory II
Discussion #11 11/21/16.
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
11 Version control (part 2)
GIT AND GITHUB WORKSHOP
A Simple Introduction to Git: a distributed version-control system
Version Control.
Git Practice walkthrough.
CS4961 Software Design Laboratory I Collaboration using Git and GitHub
Discussion 11 Final Project / Git.
Version Control overview
A Simple Introduction to Git: a distributed version-control system
Git for Visual Studio Developers MARTIN KULOV, ASE
Software Engineering for Data Scientists
Version Control with Git and GitHub
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
Version Control System
An introduction to version control systems with Git
Distributed Version Control with git
Source Code Management
The Big Picture
Getting Started with Git and Bitbucket
Part 1: Editing and Publishing Files
Using Github.
Version Control System - Git
CMPE/SE 131 Software Engineering February 14 Class Meeting
Patrick Cozzi University of Pennsylvania CIS Fall 2012
GitHub 101 Using Github and Git for Source Control
Introduction to Git and Github
Git GitHub.
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

Git CS 110 - Fall 2018

It’s never final

The Command Line The command line or command-line interface, is a text-based version of your Operating System. Like Windows Explorer or Finder on the Mac, without the graphical interface. Other names for the command line are: cmd, CLI, prompt, console or terminal. The blinking cursor is called the ‘prompt’

Commands There are hundreds of different commands you can use on the command line whoami pwd ls Some commands take parameters cd <folder>

Linux Directory Structure Directories are organized as a tree You are always in some directory many commands are relative to your current directory mkdir creates a new directory in your current working directory Windows commands are different from Mac and Linux

Managing Your Code Many of the concepts we learn in CS are an attempt to manage large projects and reduce complexity Functions, OOP, Data Structures, Design Patterns, etc. Large Project Problems: Managing large projects that go on for years with multiple people? Adding a feature without breaking the current version? What if someone’s code breaks the project? How do we revert?

Managing Your Code What we need: We need a way to maintain previous versions of our code. We’ll also need to restore previous versions We also need a way to keep everyone’s code synchronized, but only at fixed points. Finally, we need to have different versions of our code that so current development doesn’t break working, previous versions of the project.

Possible Solutions Use a Local Repository A repository, or repo, holds all the previous versions of your code. If you make a new copy of your code and save the old version in a folder called “backup” every time you make significant changes, the folder called backup is your repository. Pros: Simple, allows restore Cons: This doesn’t help with team projects Quickly grows in size

Possible Solutions Use a Centralized, Networked Repository Previous versions are on a server that all developers can access Any change made by developers must be added to the one central repository. Developers keep only the latest versions on their computer Pros: Less memory required on your machine Easier to synchronize with team Cons: Not all code is good, and somebody needs to be the gatekeeper. Consider an active project like VLC with hundreds of contributors trying to add dozens of small changes every day. How do you maintain quality?

Git A better solution is to allow developers to check in with everyone for updates when they want or are able to. Git was designed as a Distributed Version Control System (DVCS). That means that projects using Git would need developers to have a local repository stored on their system.

Git Each developer is free to test any changes made on her own local instance of the repository before committing changes Called Integration Testing and Acceptance Testing You pull in other developer's changes only when you want to.

Doesn’t that use more memory? Git only stores changed files in new versions. If a file has not changed in a version, it will be linked, not copied. Git compresses all files stored in the repository Text files compress up to 60%, and most files in a programming projects are just text files Memory is cheap cheap: a lot of it expensive: limited resource

Branching Git also introduces Branching

Branching Branching allows developers to try something out, and decide later if they want to integrate it Merge a branch with the main project at any time You can also merge a branch with another branch This allows you to try out new features without messing with the main repository

Sample Git Project

The Stages of Git - The Working Directory To initialize a git repo git init new repo git clone copy of an existing repo The working directory is the actual project in its most current state i.e. the source files you are currently working on

The Stages of Git - The Staging Area List of files ready to be placed into the next snapshot Think of this as the loading dock for your next commit To add a file git add <filename>

The Stages of Git - The Commit The Commit is the snapshot of the project in some particular state commit creates a restore point that you can use to revert to or branch from Includes snapshot, author, date, committer (can differ from author), parent commit To create a commit: git commit -am “Message stating what has changed”

The Stages of Git - The Remote A copy of more or less the same repo The remote can be any networked computer You can access the other machine with the following: git pull <machine name> <branch> git push <machine name> <branch>

Problems with Git and the Github solution Git never told us who to trust Anyone can make changes, and you may accidentally pull them Git repositories are open to all passwords saved in a file are visible to anyone GitHub is a web-based open Git repository. Brings back some centralization to git Github introduces authentication and a web interface We often call Github “the origin”

Adding Github to your workflow To add a Github repository, you need to sign up for an account It’s free and open to everyone! You must then add the Github repo as a remote to your project git remote add origin <remote repository URL> usually the github repo is called origin, but can be named anything you like

Git Universe Summary Git Github A distributed version control that allows you to maintain a repo on your system, but send and receive changes from others when they are ready Github A web service that can act as a central repository for a git repo Adds some security to a git repo, while still allowing anyone to branch

Git - Limitations Git trusts everyone to know what they are doing Anyone with permission can commit or alter the repository It’s your job to know you shouldn’t pull those changes Anyone can make any changes they want Git commands are complex and confusing I still have to look up the commands constantly Documentation of the commands is pretty terrible git-rebase – Reapply commits on top of another base tip move a branch to include another branches changes

Starting a Github Repo - Example Standard git repo procedure git init git add <filename> git commit -am “My commit message” Working with remotes git remote add origin https://github.com/myrepo.git git push origin master git pull origin master

Cloning a github repo You can clone any public github (or git based) repository git clone https://github.com/Sallenmoore/sample.git downloads the entire repo to your machine git push pushes updates (as long as you have proper authentication) git pull pulls latest updates