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

Similar documents
A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi)

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

Submitting your Work using GIT

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

Windows. Everywhere else

Version Control: Gitting Started

Chapter 5. Version Control: Git

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

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

From Commits to Collaboration: A Git Tutorial for Social Scientists

Effective Software Development and Version Control

Revision control. INF5750/ Lecture 2 (Part I)

1. Git. Robert Snapp

John DeDourek Professor Emeritus Faculty of Computer Science University of New Brunswick GIT

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

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

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

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

A Brief Git Primer for CS 350

Version control system (VCS)

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

CSCE UVM Hands-on Session-1 Pre-Work

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

Version Control with Git ME 461 Fall 2018

Git: Distributed Version Control

Introduction to Version Control

CSE 391 Lecture 9. Version control with Git

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

1/20/13 Git tutorial. Git tutorial. Mike Nolta. file:///users/nolta/github/reveal.js/git.html?print-paper#/ 1/31

Git & Github Fundamental by Rajesh Kumar.

Tutorial 2 GitHub Tutorial

Git: Distributed Version Control

Assumptions. GIT Commands. OS Commands

CS 390 Software Engineering Lecture 4 - Git

Version Control System - Git. zswu

Software Development I

Version Control with GIT

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

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

Revision Control and GIT

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

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

Barry Grant

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

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

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

Version Control. Version Control

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

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

Version control with git and Rstudio. Remko Duursma

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

Software Development. Using GIT. Pr. Olivier Gruber. Laboratoire d'informatique de Grenoble Université de Grenoble-Alpes

Git Introduction CS 400. February 11, 2018

Hg Tutorial. For : COP Object oriented Programming (Using C++) Biswas Parajuli

Software Project (Lecture 4): Git & Github

Git tutorial. Katie Osterried C2SM. October 22, 2015

Using GitHub to Share with SparkFun a

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

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

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

Computer Science Design I Version Control with Git

6 Git & Modularization

Sample Spark Web-App. Overview. Prerequisites

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

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

Git. Presenter: Haotao (Eric) Lai Contact:

Version control with Git.

Introduction to Git and Github

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

Version Control with Git

Index. Alias syntax, 31 Author and commit attributes, 334

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

Eugene, Niko, Matt, and Oliver

Introduction to Supercomputing

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

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

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

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

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

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

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Version Control Systems: Overview

Version Control Systems (Part 1)

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

Git for Version Control

Version Control. Version Control

Make sure to mark it private. Make sure to make it a Mercurial one and not a Git one.

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

Git, the magical version control

Basics of Git GitHub

ASP4100 Introduction to honours computing

LAB MANUAL GIT BY PRATIK JAIN. To start with git bash, we need to authenticate ourselves so that for every commit, git can use this information.

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

Intermediate Programming, Spring Misha Kazhdan

Version Control Systems

Lab Exercise Git: A distributed version control system

Pragmatic Guide to Git

Online Remote Repositories

Source Code Management wih git

Transcription:

A version control system (VCS) is a tool or system for keeping track of changes in files. A primitive form of VCS would be making a copy of a file every time you want to make a new version of the file. For example; lab1a.c, lab1b.c, lab1c.c, etc. The basic idea is to have some way to track multiple versions of a project including what the differences were, when they were made, and having a way to backtrack to those versions and undo changes if necessary. Many VCS have been developed over the years; rcs, cvs, svn, git. We will use git.

git is a different kind of VCS. git is a Distributed VCS. There is no centralized file server. Instead, all the contributors to a project have complete, separate copies of the project. Being decentralized also makes git a great tool to allow collaborators to all work on a project. Git is very popular and powerful. Its also well known for being hard to learn. There are many sources on the web to get help with git. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

git isn t needed for this class much. Most will use it in for pulls only. However, it is likely that if you do software, or hardware development work with hardware description languages, you will use a VCS. git can help you keep track of your work but don t use it to share your code with others. git is not a backup system, but used with the free remote repositories at github.com you can have a simple backup solution.

Getting setup to use git: First, installation: Debian-based distros: Fedora: sudo apt - get install git sudo yum install git Once you have it installed, check that its working: git -- version git should be found and should report the version

Setting up a repository: A repository is the place where git keeps track of your changes All the files and directories you intend to keep track of. The.git subdirectory holds all the tracked files recursively downward in the directory structure. The repository is stored alongside the files in the directory that you want to track.

Once you have it installed, check that its working: git -- version git should be found and should report the version Now, setup some necessary information for git: git config -- global user. name " User Name " git config -- global user. email " <user_name > @oregonstate. edu " git config -- global core. editor vim The git config commands will create a configuration file for you inside the.git subdirectory. Confirm this information is correctly in place: git config -- list

Once you are at this point, you can pull class code from github. git clone https://github.com/rltraylor/sanity.git You have the entire sanity project code directory. It is a repository as the directory contains the.git subdirectory. ls -a You can descend into the sanity directory and compile the C code there. cd sanity make

If you want to utilize more of what git can do for you, first create an account for yourself at at git-based repository provider such as: github.com. With github.com, as students, you can get unlimited private repositories for free (normally $7/month). Since our class work is to be individual work, I will expect you to use private repositories.

If you ever get messed up or simply want to forget having version control on a directory, simply remove the.git subdirectory. There is no other hidden infrastructure to find and/or remove. None of your files were ever touched by git. Let s take this action inside the sanity directory. cd sanity rm -Rf. git At this point, the sanity directory has no source code control.

Since we just removed the.git directory, it is just as if we had created the directory with sanity.c and Makefile. Let s say we did just create this directory and its contents and we want to place it under source code control. Within the sanity directory, we say: git init This will allow git to trace changes to the directory and files in it. The data structures required for this are in the.git subdirectory. Notice the addition of (our own).git ls -a

When we compile, we make a lot of downstream files. We usually don t want to track these files, just our source code and makefile since the other files can be recreated. We can limit what files git puts in the repository by using a.gitignore file A.gitignore file for AVR development might look like : *.o *. map *. bin *. lst *. hex *. elf *. srec *. eeprom. hex *. eeprom. bin git will not include or track these files for source code control. Create this.gitignore file

At this point, prior to adding anything to the repository, check the status of our directory: git status git responds: On branch master Initial commit Untracked files : ( use " git add <file >... " to include in what will be committed ). gitignore Makefile sanity.c nothing added to commit but untracked files present ( use " git add " to git is telling us that none of our files are tracked.

To begin tracking the files in our new repository, we type: git add. Now all files at this directory and recursively below are being tracked. git status git responds: On branch master Initial commit Changes to be committed : ( use " git rm -- cached <file >... " to unstage ) new file :. gitignore new file : Makefile new file : sanity. c

Now the files are tracked but that they have not been committed to the repository. Put the added files/directories into the repository with the command: git commit -m initial commit git responds: [ master ( root - commit ) 71 fd74e ] initial commit 3 files changed, 100 insertions (+) create mode 100644. gitignore create mode 100644 Makefile create mode 100644 sanity. c Now check the status again. nothing to commit, working directory clean Our files and committed files are in sync

To track and store your work, first create a remote repository on github.com. Then associate your local repository with the remote one: git remote add origin https://github.com/<user name>/sanity.git git does the last step silently Now push your work to the remote repository with the command: git push -u origin master You will be prompted for username and password Your work is now stored on the remote repository