CMPE/SE 131 Software Engineering February 14 Class Meeting

Slides:



Advertisements
Similar presentations
An Introduction By Sonali and Rasika.  Required for the project  Show the versions of your code in the course of development  Show versions of your.
Advertisements

Hosted Git github. From an alumni (2010)  You know, the more time I spent in industry the better I've understood what a strong advocate you are for the.
Using svn and git with Unity and sdk
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.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version control Using Git 1Version control, using Git.
علیرضا فراهانی استاد درس: جعفری نژاد مهر 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.
Version control Using Git Version control, using Git1.
Git (Get) it done right! Practical Applied Version Control for Drupal site developers Peter Chen - Stanford School of Engineering Technical Webmaster.
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.
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.
CS 160 and CMPE/SE 131 Software Engineering February 16 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
Hosted Git github. From an alumnus (2010)  You know, the more time I spent in industry the better I've understood what a strong advocate you are for.
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.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
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
Version control and issue tracking options for IHE PCD
CS5220 Advanced Topics in Web Programming Version Control with Git
M.Sc. Juan Carlos Olivares Rojas
4 Version control (part 1)
Information Systems and Network Engineering Laboratory II
Source Control Systems
L – Modeling and Simulating Social Systems with MATLAB
Git and GitHub primer.
LECTURE 2: Software Configuration Management
Version Control.
Setting up Git, GitBash, and GitHub
L – Modeling and Simulating Social Systems with MATLAB
Version Control overview
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
Version Control System using Git
Development and Deployment
Macaualy2 Workshop Berkeley 2017
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
An introduction to version control systems with Git
(Advanced) Web Application Development
LECTURE 3: Software Configuration Management
The Big Picture
Setting up Git, GitBash, and GitHub
An introduction to version control systems with Git
Getting Started with Git and Bitbucket
Using Github.
Git CS Fall 2018.
Version control with Git
Introduction to Version Control with Git
Introduction to Git and GitHub
Version/revision control via git
Intro to Git and GitHub Version Control using Git Carol Schofield
Git GitHub.
Introduction to The Git Version Control System
Presentation transcript:

CMPE/SE 131 Software Engineering February 14 Class Meeting Department of Computer Engineering San José State University Spring 2017 Instructor: Ron Mak www.cs.sjsu.edu/~mak

Version Control System Version control is important when you’re working on a software project over time. Many source and documentation files. The files change during development. You need to keep track of the different versions of each file, and possibly roll back to an earlier version. A version control system (VCS): Records changes to your files over time. You can recall specific versions later.

Version Control System, cont’d A VCS is critical for a multi-person project. How do you keep developers on a team from overwriting each other’s changes? How do you roll back to an earlier version of a file after deciding that the latest changes were bogus? Who has the latest and greatest version of the source files?

Local Version Control You keep track of the different versions of a file. By name, such as MyClass.rb, Myclass-old.rb, MyClass-even-older.rb, etc. By creating “time-stamped” subdirectories such as src-feb20, src-feb21, etc. and putting source files in them. Pro Git by Scott Chacon Apress, 2009

Centralized Version Control A server keeps track of all the file versions in a central repository. Developers working on different computers “check out” files from the repository, modify them locally, and then “check in” the files back into the repository. CVS Subversion Poor performance due to network delays. What if the network goes down? Pro Git by Scott Chacon Apress, 2009

Distributed Version Control Each developer has a complete local copy of the repository. How do you keep all the local copies synchronized? The server is optional. Pro Git by Scott Chacon Apress, 2009

Git Originally developed by Linus Torvalds. Creator of Linux. “I’m an egotistical bastard, and I name all my projects after myself. First Linux, now git.” git = British term for a silly or worthless person “Global Information Tracker” Extremely popular in industry and academia. For example, used by NASA.

Git, cont’d Incredibly fast. Simple design. Strong support for non-linear development. Thousands of parallel branches. Fully distributed. Each developer has a complete copy of the repository. Very efficient with large projects such as the Linux kernel.

Git: File Differences vs. Snapshots (Subversion) Snapshots (Git) Pro Git by Scott Chacon Apress, 2009

Git: Local Operations Each developer has a complete local copy of the repository on his or her laptop or workstation. Local operations add commit check in check out status differences etc.

Git: Remote Operations Do remote operations only when necessary to the master repository on the server. Clone the master repository into a local repository. Push (and merge) a local repository to the master repository. Pull (and merge) files from the master repository to a local repository. Git can work peer-to-peer without a master repository.

Local and Remote Repositories SuperCoder’s master repo REMOTE Susan’s local repo Fred’s pull push LOCAL add, commit, etc. Git can also work peer-to-peer without a master repository.

Git: Three File States A file can be in one of three states: modified staged committed Pro Git by Scott Chacon Apress, 2009

Git: Three File States, cont’d The hidden Git directory .git is the local project repository. The working directory is where you check out a version of the project for you to work on. The staging area is a file that keeps track of what will go into your next commit. The staging area is also known as the “index”. Pro Git by Scott Chacon Apress, 2009

GitHub GitHub is a popular website for hosting remote Git repositories. https://github.com/ The free service hosts public repositories. Anyone can view your repository contents.

GitHub: Create Personal Account Go to http://git-scm.com/downloads Download and install Git on your local machine. Go to https://github.com/ Create a personal account with a recognizable user name such as johndoe or jdoe. Set up SSH keys to establish a secure connection with GitHub. See https://help.github.com/articles/generating-ssh-keys

GitHub: Create Team Repository One team member creates the team’s master repository at GitHub See http://help.github.com/create-a-repo/ Initialize the repo with a README file. Possible ways to get private git accounts: BitBucket (another git server) education.github.com (get a free private GitHub account)

GitHub: Create Team Repository, cont’d Obtain the GitHub username of each team member. Add team members as contributors to the team repository. Click the Settings tab. Click Collaborators in the left Options panel. Add collaborators using each team member’s GitHub username.

GitHub: Create Local Repository Each team member creates local repository that is a clone of the master repository. Log into your personal GitHub account. Search for your team’s master repository by name in the search box at the top. Click on the link to the team repository. Obtain the URL to the team repository. On the team repository page, look for HTTPS clone URL in the right side panel. Put the URL on the clipboard.

GitHub: Create Local Repository, cont’d

GitHub: Create Local Repository, cont’d cd to the directory where you want the local repository to reside on your local machine. Enter the git command where URL is the URL from the clipboard Example: git clone URL git clone https://github.com/ronmak/SJSU-CS153-SuperCoders.git

Git: Make Local Changes Get the status of files in your local repository: After you’ve modified files (or created new files) on your local machine, first add them to the local staging area: Commit your staged files to the local repository: git status git add myfile1 myfile2 git commit –m "commit message"

Git: Already Have Local Files? If you already have a local directory of files: cd to the directory and then do to create a local repository. Do git add to enter each file into the local repository, followed by git commit. git init

Git: Push to the Master Repository From the directory of the local repository, push your local repository contents up to the master repository at GitHub. If another team member had pushed the same files since you last obtained them from the master repository, or added new files, you’ll have to pull down the changed or new files in order to merge them into your local repository before you can push. git push git pull

Git Tutorials and References Pro Git book online: http://git-scm.com/book Chapter 5 Distributed Git is especially helpful. Especially tricky topics: branching and merging.

GitHub: Repository Statistics A repository’s overall work statistics are public.

GitHub: Repository Statistics, cont’d An individual team member’s work statistics are public.

SmartGit GUI-Based Git Interface See: http://www.syntevo.com/smartgit/

Assignment #2. Source Code Repository Each team creates a source code repository in GitHub. It can be public or private. One team member creates the repository and invites the other team members to be collaborators. Each team member must first create a GitHub account. Use each team member’s GitHub account name for the invitation.

Assignment #2, cont’d If your account is public, submit the name of your repository into Canvas. If your account is private, invite ProfMak and cmpe131spring2017 (ISA Melvin Ch’ng) to be collaborators. We’ll be silent collaborators. If your repository is not on GitHub. Submit instructions on how Melvin and I can monitor your team’s work during the semester.

Deployment to Heroku You need to deploy your application to the Web. Deploy to Heroku. A cloud application platform Platform as a Service (PaaS). Sign up for a free account http://www.heroku.com Create a team account Install the Heroku Toolbelt http://toolbelt.heroku.com

Deployment to Heroku, cont’d Follow the Rails book’s instructions: Install the PostgreSQL gem pg. Install the Heroku gem rails_12factor Create an application on Heroku Set up a remote git account on Heroku Push your local master branch to Heroku Create your database on Heroku An example deployment of the blog application https://damp-ravine-81792.herokuapp.com