Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Version Control CS440 – Introduction to Software Engineering © 2014 – John Bell Based on slides prepared by Jason Leigh for CS 340 University.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
SubVersioN – the new Central Service at DESY by Marian Gawron.
GIT is for people who like SVN September 18 th 2012 Vladimir Kerkez and BK.
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
Introduction to Git and Github Joshua imtraum.com.
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 with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
A primer on version control at OTN
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.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Version Control. How do you share code? Discussion.
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.
Version Control System Lisa Palathingal 03/04/2015.
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.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 16 – Version control and git.
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.
Lecture 5 Remotes Sign in on the attendance sheet! Turn in homework at the front!
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
Collaborative Git An introduction to Git with others
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
GIT: (a)Gentle InTroduction Bruno Bossola. Agenda About version control Concepts Working locally Remote operations Enterprise adoption Q&A.
Version Control Systems
CS5220 Advanced Topics in Web Programming Version Control with Git
Information Systems and Network Engineering Laboratory II
Source Control Systems
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
Version Control with Subversion
Version Control.
Version Control overview
Version Control System using Git
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
The Big Picture
SIG: Open Week 1: GitHub Tim Choh.
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Git and GitHub
Version Control with Git
Version Control with Git and GitHub
Introduction to The Git Version Control System
Presentation transcript:

Molecular Biomedical Informatics 分子生醫資訊實驗室 Web Programming 網際網路程式設計 1

Git 2 Version Control - Episode 1 - Introduction 提升程式設計師生產力最好的工具是什麼? Git and Github Web Programming 網際網路程式設計

Why Web Programming 網際網路程式設計 3 version control version control system

Suppose that Web Programming 網際網路程式設計 4 Alice and Bob are co-working on a html file, how do you do version control

Diff Take turns? One solution is that both work on local copies and sync (merge) later (filename is used for version control) –in this case there is a conflict –someone need to solve it diff is a tool to help sync –diff v1.alice.html v1.bob.html Or you can use vi’s diff mode –vi –d v1.alice.html v1.bob.html Web Programming 網際網路程式設計 5

Diff Take turns? One solution is that both work on local copies and sync (merge) later (filename is used for version control) –in this case there is a conflict –someone need to solve it diff is a tool to help sync –diff v1.alice.html v1.bob.html Or you can use vi’s diff mode –vi –d v1.alice.html v1.bob.html Web Programming 網際網路程式設計 6

Diff Take turns? One solution is that both work on local copies and sync (merge) later (filename is used for version control) –in this case there is a conflict –someone need to solve it diff is a tool to help sync –diff v1.alice.html v1.bob.html Or you can use vi’s diff mode –vi –d v1.alice.html v1.bob.html Web Programming 網際網路程式設計 7

How Web Programming 網際網路程式設計 8 Bob should do if he finds v1.alice.html while editing v1.bob.html

Patch Bob can merge v1.alice to his local copy and keep editing –but if there is 1, 2… n more new versions during the editing –changes in v1.alice ↔ v1.bob is hard, since both changes –changes in v1.alice ↔ v1 is easy Apply v1 → v1.alice on Bob’s local copy –diff –u v1.html v1.alice.html > alice.patch –edit the filename in alice.patch if required –patch alice.patch Web Programming 網際網路程式設計 9

Patch Bob can merge v1.alice to his local copy and keep editing –but if there is 1, 2… n more new versions during the editing –changes in v1.alice ↔ v1.bob is hard, since both changes –changes in v1.alice ↔ v1 is easy Apply v1 → v1.alice on Bob’s local copy –diff –u v1.html v1.alice.html > alice.patch –edit the filename in alice.patch if required –patch alice.patch Web Programming 網際網路程式設計 10

Patch Bob can merge v1.alice to his local copy and keep editing –but if there is 1, 2… n more new versions during the editing –changes in v1.alice ↔ v1.bob is hard, since both changes –changes in v1.alice ↔ v1 is easy Apply v1 → v1.alice on Bob’s local copy –diff –u v1.html v1.alice.html > alice.patch –edit the filename in alice.patch if required –patch alice.patch Web Programming 網際網路程式設計 11

Tips of diff and patch diff –Naur [from] [to] patch –dry-run –p1 Then google :p Web Programming 網際網路程式設計 12

Any Questions? Web Programming 網際網路程式設計 13 about diff and patch

How Web Programming 網際網路程式設計 14 Bob finds v1.alice.html

Server More common, repository So far, think it as a FTP server is fine No one can edit directly on the server copy –once the filename (version) fixes, the content fixes –any change induces a new file (version) So users have to change the filename (under some rules) of local copies and upload it to the server, namely commit Other users can download the new versions, diff and patch local copies, namely update Web Programming 網際網路程式設計 15

Version control system Provide a server for store/access versions Control versions instead of filenames –no more file renaming, keep it index.html rather than index.v1.html, index.v2.html… –a new version is automatically generated via commit Auto diff and patch –precisely, auto diff when committing, auto patch when updating Detect conflicts –if no conflict exists, auto merge/solve –the later committer is responsible to solve conflicts –a version might be overwritten, but never lost, which can be easily recovered Web Programming 網際網路程式設計 16

History of version control systems rcs, cvs, svn, (svk), git Then google :p rcs only handles version control but not collaboration issues cvs and svn are similar, but svn was more popular (because of better GUI?) svk was developed by clkao (my classmate), which is a distributed system Doesn’t matter, git wins Web Programming 網際網路程式設計 17

History of version control systems rcs, cvs, svn, (svk), git Then google :p rcs only handles version control but not collaboration issues cvs and svn are similar, but svn was more popular (because of better GUI?) svk was developed by clkao (my classmate), which is a distributed system Doesn’t matter, git wins Web Programming 網際網路程式設計 18

Distributed Web Programming 網際網路程式設計 19 Local version control system (rcs) –no collaboration Centralized version control system (cvs, svn) –slow/no network –single point of failure Distributed version control system (svk, git) –a complete/full-functional repository at local

Distributed Web Programming 網際網路程式設計 20 Local version control system (rcs) –no collaboration Centralized version control system (cvs, svn) –slow/no network –single point of failure Distributed version control system (svk, git) –a complete/full-functional repository at local

Distributed Web Programming 網際網路程式設計 21 Local version control system (rcs) –no collaboration Centralized version control system (cvs, svn) –slow/no network –single point of failure Distributed version control system (svk, git) –a complete/full-functional repository at local

By Linus Torvalds

Linus Torvalds (born Dec 28, 1969) Linux creator Linus adopted BitKeeper, a distributed version control system –before that, Linux kernel was released by patch files He breached with BitKeeper at 2002, so he created a new one, git Git was released at 2005, now everybody uses it –never breach with masters The first project that uses git, Linux kernel –did you develop any project larger than Linux kernel? Web Programming 網際網路程式設計 23

Snapshots, not differences Web Programming 網際網路程式設計 24 Fast, and not stupid Capable as a mini file system

Staging Sometimes you changed many files but only some of them are ready to commit Web Programming 網際網路程式設計 25

How many you remember Web Programming 網際網路程式設計 26 commit, conflict, diff, merge, patch, repository (repo), staging, solve, update, …

Tips of git git add # add files to staging (then commit to repo) git push # pu sh/sync the local repository to a remote repository git checkout # c hec kout/update files from repo to working git pull # pull/sync remote repository to the local repository and checkout git diff # diff two versions without checkout them first git clone # clone/copy an existing repo here git help # the most useful one Web Programming 網際網路程式設計 27

Demo A step-by-step for newbies? –Git - BookGit - Book –Git and GithubGit and Github – 寫給大家的 Git 教學 寫給大家的 Git 教學 –A Visual Git ReferenceA Visual Git Reference So I don’t want another one, and… Web Programming 網際網路程式設計 28

Use it now Web Programming 網際網路程式設計 29 or you never know git

Any Questions? Web Programming 網際網路程式設計 30 about git

GitHub? 31 a git server implementation Web Programming 網際網路程式設計

GitHub Okay, it should be the best git server implementation Do you know hub? –GitHub stores many projects It is a web service that uses git for project development –issue system, statistics, social elements… There are other git servers such as gitolite –useful when you want privacy and don’t want to pay There are many step-by-step tutorials of GitHub online, so here let’s not humiliate our intelligence Web Programming 網際網路程式設計 32

Today’s assignment 今天的任務 Web Programming 網際網路程式設計 33

Clone a GitHub repo You need to install git, register a GitHub account and clone an interesting repo. If you have no idea, 成電新手村 is a good choice. Try run nckuee-village on your server or your merry home. If you want to contribute (e.g. commit something), just let me know. 成電新手村 Reference –GitGit –GitHubGitHub Your web site ( ex13) will be checked not before 23:59 1/14 (Tue). You may send a report (such as some important modifications) to me in case I did not notice your features. Or, even better, just explain your modifications in the homepage. Web Programming 網際網路程式設計 34

Appendix 35 Web Programming 網際網路程式設計

Step-by-step of git environment Download git and install it ( Enter git console (many ways, in Windows 7, try [Start]  type git) Generate personal private/public keys –ssh-keygen –remember the location (in Windows 7, try C:\Users\xxx\.ssh) –id_rsa is your private key, keep it at local and NEVER spread it –id_rsa.pub is your public key (give it to the git server or project manager) Set your name and –git config --global user.name “xxx” –git config --global user. “xxx” Web Programming 網際網路程式設計 36

Clone a GitHub repo Enter git console Change to a folder that you store projects –cd path/to/projects Clone the repo –git clone village.git –or –git clone village.githttps://github.com/mbilab/nckuee- village.git –path/to/projects/nckuee-village/ will be your working directory Web Programming 網際網路程式設計 37

Create a GitHub repo Sign up at GitHubGitHub Setup your public key –[Account Setting]  [SSH Keys]  [Add SSH Key]  paste your public key in [Key] Create a GitHub repo: [Repositories] (repo in short)  [New] Enter git console Change to the working directory –cd path/to/projects/project/ Initialize –git init –git remote add origin [URL of the GitHub repo] Create the first version, namely commit something –git add xxx –git commit -m “comment of this commit” Push it to the server (GitHub), and you can see it on GitHub –git push origin master Web Programming 網際網路程式設計 38