The Big Picture

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.
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 ▪Version control is a system that records changes to a file or set of files over time so.
Subversion (SVN) Tutorial Source:
Version Control. How do you share code? Discussion.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
…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.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Git Fundamentals Rochelle Terman 13 January 2014.
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.
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.
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.
1. A new git is initialized as a remote repository JohnRemote repositoryPeter master C0 CodingWhileBlack.com PROPEL CODING
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
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.
GIT: (a)Gentle InTroduction Bruno Bossola. Agenda About version control Concepts Working locally Remote operations Enterprise adoption Q&A.
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Version Control Systems
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to GitHub
Information Systems and Network Engineering Laboratory II
L – Modeling and Simulating Social Systems with MATLAB
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
11 Version control (part 2)
CReSIS Git Tutorial.
Version Control.
Git Practice walkthrough.
CS/COE 1520 Recitation Week 2
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
Macaualy2 Workshop Berkeley 2017
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
Version Control with Git accelerated tutorial for busy academics
Git Workflows.
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
SIG: Open Week 1: GitHub Tim Choh.
Advantages Project Career Divide & Conquer Collaboration
Source Code Repository
Git and Jira Tutorials Kan Qi
Using Github.
Git CS Fall 2018.
Introduction to Git and GitHub
Git started with git: 2018 edition
Version Control with Git
GitHub and Git.
Version Control with Git and GitHub
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

Github Tutorial Kan Qi kqi@usc.edu

The Big Picture http://blog.mikepearce.net/2010/05/18/the-difference-between-git-pull-git-fetch-and-git-clone-and-git-rebase/

Local environment workspace Index The directory in your file system where you hold your project source code. git init git clone <repo-url> Index containing a sorted list of file paths. git ls-files --stage git add git rm

Local environment - cont’d Local repository .git directory in your workspace directory Hold branches and commits for each branch. HEAD refers to the currently checked out commit. git commit [-m] git pull <remote> <branch> git checkout <branch> git push <remote> <branch> git fetch git revert <commit-ish>

Remote repository Remote repository is a repository hosted somewhere on Internet or local network. Commands available to manage remote repositories git remote [-v | --verbose] git remote add <name> <url> git remote remove <name> git remote set-url <name> <newurl> Four transfer protocols http local git SSH To be able to collaborate on any Git project, you need to know how to manage your remote repositories. Remote repositories are versions of your project that are hosted on the Internet or network somewhere. You can have several of them, each of which generally is either read-only or read/write for you. Collaborating with others involves managing these remote repositories and pushing and pulling data to and from them when you need to share work. Managing remote repositories includes knowing how to add remote repositories, remove remotes that are no longer valid, manage various remote branches and define them as being tracked or not, and more. In this section, we’ll cover some of these remote-management skills.

Collaboration - Typical workflow Person A Setup project & repo push code onto github edit/commit pull/push Person B clone code from github edit/commit/push edit… edit… commit pull/push

Collaborating - clone git clone https://github.com/<user name>/<repository name>.git git clone https://github.com/flyqk/577a_2017_demo_project.git

Collaborating - fetch, pull Options for synchronizing: Fetch Fetch all the branches to local repository to be able to access the remote branches. git fetch <remote> Pull Pull the changes in remote branch and apply those changes directly to the workspace. Usually we need to solve conflicts after we pull. git pull <remote> <branch>

Collaborating - merge,push Merge the current working branch with another branch. git merge <branch> Push Push the commit you make in local repository to remote repository git push <remote> <branch>

Demo - Collaboration User1 and user2 both clone the same project from github git clone https://github.com/flyqk/577a_2016_demo_project.git User1 make some changes and commit to the remote master branch. git commit -m “edit readme file for greeting” git push origin master User2 is also doing some changes in local and commit to local repository. When user2 pushes the local commit, it conflicts with the remote master branch. User2 pulls the commit from remote and solve the conflicts. git pull User2 commits and pushes again. git commit -m “solve the conflict about the readme file”

Demo - Collaboration - cont’d User2 creates a branch named “maintain_branch” in local. git checkout -b “maintain_branch” User2 makes changes and commit into “maintain_branch” git add --all & git commit -m “added maintain branch” User2 pushes the branch into remote repository git push –-set-upstream origin maintain_branch User1 fetches the branch from the remote repository and merge the two branches by solving the conflicts. git fetch git merge maintain_branch User1 pushes the master branch with the changes from maintain branch back to remote repository git push origin master

577a course project requirements Every team should host their project on github in private repository Register a student account, and you get up to 5 private repository quota Add TAs as collaborators. Commit message format Git commit -m “your comment” E.g git commit -m “added username format check function”