Online Remote Repositories

Similar documents
What is Git? What is Git? Version Control. Barry Grant

BARRY. Barry Grant

BIMM 143. Find-a-Gene Project Assignment. Find a Gene Assignment. Barry Grant. Lecture 10.

BIMM 143. Find-a-Gene Project Assignment. Find a Gene Assignment. Barry Grant. Lecture 10.

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

Tips on how to set up a GitHub account:

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

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

CS 390 Software Engineering Lecture 5 More Git

Git. Presenter: Haotao (Eric) Lai Contact:

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Introduction to Git and Github

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

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

Software Development I

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

Lecture 2: Data in Linguistics, Git/GitHub, Jupyter Notebook. LING 1340/2340: Data Science for Linguists Na-Rae Han

Software Project (Lecture 4): Git & Github

Computer Science Design I Version Control with Git

Tutorial 2 GitHub Tutorial

How to git with proper etiquette

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

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

Git for Version Control

Version Control System - Git. zswu

Using git to download and update BOUT++

Improving Your Life With Git

Version Control with Git ME 461 Fall 2018

A BASIC UNDERSTANDING OF VERSION CONTROL

Intro to Github. Jessica Young

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

Using Git to Manage Source RTL

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

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

Visualizing Git Workflows. A visual guide to 539 workflows

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Github/Git Primer. Tyler Hague

Revision control Advanced git

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

Version Control with GIT

Version control with Git.

Git for Newbies. ComMouse Dongyue Studio

Git & Github Fundamental by Rajesh Kumar.

CSE 391 Lecture 9. Version control with Git

Revision Control and GIT

Git Basi, workflow e concetti avanzati (pt2)

CS314 Software Engineering Configuration Management

Getting started with GitHub

A Brief Git Primer for CS 350

Introduction to Version Control with Git

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

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

I m an egotistical bastard, and I name all my projects after myself. First Linux, now git. Linus Torvalds, creator of Linux and Git

Code Repository. P Blanchfield

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

The Old World. Have you ever had to collaborate on a project by

L Modeling and Simulating Social Systems with MATLAB

Esri on GitHub: How to Participate in Open Source Projects

Lab 08. Command Line and Git

Version control system (VCS)

Git: Distributed Version Control

License. Introduction to Version Control with Git. Local Version Control Systems. Why Use Version Control?

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

699DR git/github Tutorial

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

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

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

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

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

Using GitHub to Share with SparkFun a

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

Welcome! Virtual tutorial will start at 15:00 GMT. Please leave feedback afterwards at:

Distributed Version Control

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

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

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

GitHub for Developers Training Manual. -v1.0

Working with GIT. Florido Paganelli Lund University MNXB Florido Paganelli MNXB Working with git 1/47

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

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Submitting your Work using GIT

Git: Distributed Version Control

Barry Grant

Version Control: Gitting Started

Version Control. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

Table of Contents. Concepts

FEEG Applied Programming 3 - Version Control and Git II

Reproducibility with git and rmarkdown

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

Git. Ľubomír Prda. IT4Innovations.

Git, the magical version control

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

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

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

Creating a Patch. Created by Carl Heymann on 2010 Sep 14 1

git-flow Documentation

b. Developing multiple versions of a software project in parallel

G E T T I N G S TA R T E D W I T H G I T

Git for Subversion users

Transcription:

Online Remote Repositories GitHub and Bitbucket centralized Git repositories for dissemination and collaboration Barry Grant bjgrant@umich.edu http://thegrantlab.org

Recap: Client-Server vs Distributed VCS Client-server approach Distributed approach For distributed version control systems like Git a remote repository (e.g. an online Git repo at GitHub or Bitbucket) promotes further dissemination and collaboration.

Your Directory Staging Area Local Repository status add checkout commit

Your Staging Local Remote Directory Area Repository Repository status add checkout commit clone pull push

GitHub & Bitbucket GitHub and Bitbucket are two popular hosting services for Git repositories. These services allow you to share your projects and collaborate with others using both public and private repositories*. https://github.com https://bitbucket.org

What is the big deal? At the simplest level GitHub and Bitbucket offer backup of your projects history and a centralized mechanism for sharing with others by putting your Git repo online. GitHub in particular is often referred to as the nerds FaceBook and LinkedIn combined. At their core both services offer a new paradigm for open collaborative project development, particularly for software. In essence they allow anybody to contribute to any public project and get acknowledgment. [We will demo this later!]

Public contributing by fork & pull For any public project on GitHub or BitBucket you can make any change you like - that is you don t first need permissions to contribute your improvements/bug-fixes/ideas etc. There are two mechanisms for doing this: 1. For trusted collaborators (via a shared repository and regular commit & push steps) 2. Joe public (via a different fork & pull request approach) You don't have to beg for permission (just submit a pull request) on GitHub or BitBucket and your changes with attribution will be in the project and its history once approved!

First sign up for a GitHub account https://github.com

Pick the FREE plan!

Your GitHub homepage Check your email for verification request

Skip the hello-world tutorial https://guides.github.com/activities/hello-world/

Name your repo demo1_github

Lets push an existing repository Change back in your Terminal/MobilXterm App > cd ~/Desktop/git_class # Your local repo > git remote add origin https://github.com/ YourGitHubUserName/demo1_github.git > git push -u origin master (Tip: you can get the long URL in step2 here from your GitHup page)

Lets push an existing repository Change back in your Terminal/MobilXterm App > cd ~/Desktop/git_class # Your local repo > git remote add origin https://github.com/ YourGitHubUserName/demo1_github.git > git push -u origin master Congratulations! You just pushed your local repo to GitHub!! Check it out in your web browser

Lets edit README online Specifically lets add some Markdown content

Lets also edit locally And rename README to README.md > mv README README.md # Move to Markdown > git status > git add README.md README > git push -u origin master # What happened and why?

We need to pull changes first! > git pull origin master # Sync from GitHub > git status # What does the msg mean? > git push -u origin master # Sync to GitHub

Success! Lets look at how GitHub presents your commit history

Do it Yourself! Demo 2 https://github.com/bioboot/demo2-github

Summary: Forking, Pull requests & code review Using these three steps you can contribute any public project even though you don t have write access. You first fork the repo you are interested in. This creates a completely separate copy of the repo by cloning it and adding a copy to YOUR GitHub (or Bitbucket) account. You then make your changes (in your forked repo) and submit a pull request back to the original repo. These undergo code review and, if approved, subsequent merging into the original repo.

Side-Note: Keeping your fork up to date When the central repository is updated with someone else s code (after your fork was created), these new commits do not magically appear on your fork. You will need to add a link to the original upstream central repository to be able to pull changes. > git remote add upstream https://github.com/ bioboot/demo2-github.git > git remote -v > git pull upstream master # Can you now push to upstream?

Optional: Further self exploration of BitBucket/GitHub/Git features Issues are integrated into repos and enable bug tracking, feature requests, to-do items, questions etc. on a per project basis. E.G. https://bitbucket.org/grantlab/bio3d/issues Websites and Wikis. For example I have course websites hosted on GitHub and authored collaboratively via git. See: https://github.com/bioboot/web-2015 http://w16.bioinfquiz.org Some git commands to play with: > git show > man git-blame > git log --stat > git log --graph --oneline

Side-Note: Identifying how to contribute to an open source project Oftentimes open source projects place a CONTRIBUTING.md file in the root directory. It explains how a potential contributor should format code and submit patches etc. Here is a fine example from the ggplot2 R package. From a maintainer's point of view, the document succinctly communicates how best to collaborate. And for a contributor, one quick check of this file verifies their submission follows the maintainer's guidelines.

Summary Git is a popular distributed version control system that is lightweight and free GitHub and BitBucket are popular hosting services for git repositories that have changed the way people contribute to open source projects Introduced basic git and GitHub usage and encouraged you to adopt these best practices for your future projects.

Learning Resources Set up Git. If you will be using Git mostly or entirely via GitHub, look at these how-tos. < https://help.github.com/categories/bootcamp/ > Getting Git Right. Excellent Bitbucket git tutorials < https://www.atlassian.com/git/ > Pro Git. A complete, book-length guide and reference to Git, by Scott Chacon and Ben Straub. < http://git-scm.com/book/en/v2 > StackOverflow. Excellent programming and developer Q&A. < http://stackoverflow.com/questions/tagged/git >

Learning git can be painful! However in practice it is not nearly as crazy-making as the alternatives: Documents as email attachments Hair-raising ZIP archives containing file salad Am I working with the most recent data? Archaelogical digs on old email threads and uncertainty about how/if certain changes have been made or issues solved

Finally Please remember that GitHub and BitBucket are PUBLIC and that you should cultivate your professional and scholarly profile with intention!

Side-Note: Changing your default git text editor You can configure the default text editor that will be used when Git needs you to type in a message. > git config --global core.editor nano If not configured, Git uses your system s default editor, which is generally Vim.