How to be a 1337 h4ck3r: Git + Linux

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

Version Control with Git

Version Control: Gitting Started

Git & Github Fundamental by Rajesh Kumar.

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Intro to Linux & Command Line

Introduction to the UNIX command line

Software Development I

Git, the magical version control

Git for Version Control

CSE 391 Lecture 9. Version control with Git

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

Revision Control and GIT

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

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

Overview. 1. Install git and create a Github account 2. What is git? 3. How does git work? 4. What is GitHub? 5. Quick example using git and GitHub

2 Initialize a git repository on your machine, add a README file, commit and push

Version control with Git.

Git for Newbies. ComMouse Dongyue Studio

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

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

Getting started with GitHub

Using git to download and update BOUT++

Recitation #1 Boot Camp. August 30th, 2016

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

Windows. Everywhere else

Effective Software Development and Version Control

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!

Using GitHub to Share with SparkFun a

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

Eugene, Niko, Matt, and Oliver

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

How to be a git. Dominic Mitchell

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

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

Lecture 01 - Working with Linux Servers and Git

Human-Computer Interaction Design

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Recitation #1 Unix Boot Camp. August 29th, 2017

How to version control like a pro: a roadmap to your reproducible & collaborative research

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

Introduction to Scientific Computing

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Intro to Git. Getting started with Version Control. Murray Anderegg February 9, 2018

Version control system (VCS)

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

Version Control for Fun and Profit

Version control. what is version control? setting up Git simple command-line usage Git basics

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

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

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

Managing Network Configurations with Git and GitLab

Tips on how to set up a GitHub account:

Intro to Github. Jessica Young

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

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

Online Remote Repositories

Revision Control. An Introduction Using Git 1/15

Introduction. File System. Note. Achtung!

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Fundamentals of Git 1

Revision control. INF5750/ Lecture 2 (Part I)

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

Git. all meaningful operations can be expressed in terms of the rebase command. -Linus Torvalds, 2015

Accessing OSIRIS and using OSIRIS through GitHub

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

Lecture Homepages as of FS 2017

Human-Computer Interaction Design

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

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

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

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


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

Introduction to Git and Github Repositories

Laboratorio di Programmazione. Prof. Marco Bertini

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Continuous translation with Weblate. Michal Čihař

How to git with proper etiquette

Version Control with Git ME 461 Fall 2018

! #Running this command from the top directory of your project will add all your changes."! $ git add."

Computer Science Design I Version Control with Git

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

Version Control Systems

Programming with Haiku

Git. Presenter: Haotao (Eric) Lai Contact:

GIT TO DA REPO! VERSION CONTROL, GITLAB, AND ISU

Linux and Git Boot Camp

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

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

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Version Control with Git

Chapter 5. Version Control: Git

Software Revision Control for MASS. Git Basics, Best Practices

CSCI 2132 Software Development. Lecture 5: File Permissions

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

Barry Grant

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

Lab 1 1 Due Wed., 2 Sept. 2015

Transcription:

How to be a 1337 h4ck3r: Git + Linux An introduction to Git, version control, and Linux by Samsara Counts, Pat Cody, and Joseph Schiarizzi Slides adapted from Neel Shah and Phil Lopreiato

DISCLAIMER: GW ACM does not promote illegal and/or unethical activity (hacking or otherwise), and that s not the focus of this workshop! Most importantly, computer scientists come in ALL forms and that s why our field is so great! To quote Melinda Gates: Not every good idea comes wrapped in a hoodie. It s time the world starts recognizing that the next Bill Gates might not look anything like the last one.

1337 h4ck3rz?? Why 1337 h4ck1ng?...well, you ve seen the hacker stereotype, that s not any sort of true. (smh) The cool thing about hackers is that they re powerful af. And you know what? So are you, when you learn how to use Git and the command line!

1337 h4ck3rz??, cont. Why Git? Why Linux? git and linux are the essential tools of good programming: streamlining your workflow and keep track of different versions of your code

Goals of this workshop: 1. you know the basic tools to be a good CS and software developer 2. You have a jumping off point to build up a digital portfolio and dive into software projects

This workshop PART I: Linux and UNIX-like environments A. Linux background, the command line, + commands B. Command line hacking: make a directory! C. More background! D. More Command line hacking: edit a file in vim! PART II: Git and version control A. git background B. get git; try out github C. github background D. Clone our git repo + add a file; make your first pull request

Your Workshop TODO: 1. Put away your laptop (until we say so) and turn off your phone 2. Follow along! 3. Ask lots of questions 4. When it s time to try things out, READ OUR DOCS.

Resources + Documents for this workshop 1. Unix/Git Workflow Cheatsheet 2. Git Cheatsheet 3. Workshop Repository + README 4. Presentation Slides

PART I: Linux and UNIX-like environments In thin socks, I'm butthurt...crashing Linux server - Busdriver, Worlds To Run (ft. Anderson.Paak & milo)

Wat is a Linux. An Open Source Operating System modelled on UNIX. Always FREE and community built & maintained. All supercomputers use linux and most servers. Tux

History of Linux. Released on September 17th, 1991 by Linus Torvald Took off fast to escape Microsoft monopoly Many different distributions now available Tux

Wat is a command line interface a text-based application for viewing, handling, and manipulating files directly on your computer What 1337 h4ck3rz/ Comp Scis use

Basic Linux commands ls [dirpath] - list files in directory cd [dirpath] - change directory to dir mv [file] [dirpath] - move file to dir mkdir [dirname] - make directory dirname rm [file] - delete a file/directory* * - CAN T BE UNDONE, rm ing a directory needs -r recursive option

basic Linux names/commands, cont. > [filename] - make a new file called filename ~ - reference to the home directory... - reference to this (current) directory - reference to directory above current directory

It s hacking time! (part I)

Do now (on your laptop): 1. open https://github.com/gw-acm/git-linux-2017 for UNIX cheat sheet, basic instructions, + links 2. https://acm.seas.gwu.edu/ws/git-linux-17/ index.html 3. Then, - Mac/Unix: open Terminal (command line) - Windows: download git bash and open it

Do now, cont: (on the command line): 1. list visible directories from current position 2. Make a directory 3. Navigate into that directory 4. make a file called new.txt 5. Copy a file from another location and put it in this folder (.) 6. Remove that file

DEMO I!

More Linux commands pwd - print working directory head [file] - show first 10 lines of file tail [file] - show last 10 lines of file clear - clear screen grep expression [dir] - search for expression in dir

Intro to vim vim is a multipurpose text editor for the command line The name vim comes from vi improved, where vi is an older, less cool command line text editor

vim editing modes normal mode allows you to highlight segments of text, jump to line numbers, and enter commands like write and quit insert mode lets you enter and delete text visual mode lets you copy and paste

Vim commands vim [filename] esc i :wq :w :q! - open [filename] with vim go back to normal mode go to insert write (save) and quit write force quit (doesn t save)

It s hacking time! (part II)

Do now (on the command line): 1. 2. 3. 4. 5. 6. 7. enter cd Navigate back to directory enter vim and edit new.txt In vim, edit that file Write and exit vim Look at the first lines of that file Remove that file

DEMO II!

PART II: GIT and version control Git your life together Slides adapted from Neel Shah and Phil Lopreiato

What is git? Git is a type of version control software It s a way to track changes to files How would you do that? Many zip files Timestamped directories A specially ordered collection of stones Magic? Somebody smart decided to synchronize their files with a local database - this is local version control

How is git structured? You keep projects in repositories (repos) that are backed up on a server you work in local copies of repos, then push changes to server

What Is It? But what if you want to share your changes with someone else? Easy - just send the database to a server! This is called centralized version control But what happens if the central server goes down?

What Is It? Just make clients check out the full contents of the repository then! Now, everybody who works on a project has a full copy of the history in case something happens This is called distributed version control Many common VCS systems use this (git or Mercurial, for example) GitHub (github.com) is a popular web-based Git repository hosting service

Git Ancient History In 2005, the Linux Kernel project needed a new source control system Linus Torvalds set out to write his own Popular version control software at the time was not good enough for him Needed to be distributed and protect against corruption Development began April 3, the project was announced April 6, became self-hosting on April 7, and used in the kernel by June

How does it work? Git is a Directed Acyclic Graph of repository snapshots Every change is initially done locally Every change has verified integrity The repository is checksummed after every change That checksum is used to refer to each commit In many ways you can just see Git as a filesystem it is content-addressable, and it has a notion of versioning, but I really really designed it coming at the problem from the viewpoint of a filesystem person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system. - Linus

It s (git) hacking time! (part III)

How can I Git Git? http://git-scm.com/downloads You can now use git in a terminal or Git Bash on Windows Configuration...

Do now: make an account! Go to https://github.com/join and create an account (or log in) Get familiar with git! https://try.github.io/

(Demo unnecessary)

What s this GitHub? GitHub makes coding social by providing a Git repository hosting service that maintains all of the distributed features of Git and adds a social aspect Issue Trackers Code Releases Project Websites Anyone can contribute!

basic git workflow commands git clone repo url - create local copy of repo on your computer git add * - add all files to commit git commit -m init - save all your edits with message init git push - push your changes to origin branch of repo you re working on

branching on git on a project, you're going to have a bunch of different features + ideas in progress at a time some of which are ready to go, and others which aren t branch - an environment where you can try out new ideas. Changes you make on a (named) branch don't affect the master branch. Branching exists to help you manage this workflow.

Cloning, forking, and branches

branching git workflow commands git checkout -b new branch - switch to new branch git checkout branch - switch to branch git push origin branch - push changes to origin of branch you re working on

Distributed versions, visualized

It s (github) hacking time! (part IV)

Do now (on github + command line): 1. Full instructions in the README: https://github.com/gw-acm/git-linux-2017 2. fork the above repository on your account 3. On the command line, navigate into the directory you made 4. Clone your fork of the repository on your computer 5. Navigate into that repository 6. Use touch to make a.txt file with your name on it (ex: samsara.txt)

Do now (on github + command line): 7. 8. Tell git you made changes with add Commit those changes with a nice Message 9. Push them to your forked repo 10. On github, submit a pull request to our original repository

DEMO IV!

Links + Further reading GitHub workflow GUIDES Git branch guides https://git-scm.com/docs http://wildlyinaccurate.com/a-hackers-guide-to-git/ Some other SCMs https://guides.github.com/introduction/flow/ Git documentation https://guides.github.com/activities/hello-world/ http://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1 http://blog.udacity.com/2015/06/a-beginners-git-github-tutorial.html Mercurial SubVersion Some other Git hosts Phabricator Bitbucket GitLab

GitHub Example GitHub profiles: https://github.com/aaroncoplan https://github.com/samsaranc Example Repositories: Linux The Blue Alliance Example Organization: GWCloudLab Explore other repos and projects: https://github.com/explore

Fin. Happy h4ck1ng!