Git is a Source Control Management Tool/Version Control System.

Slides:



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

Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Version Control Systems Phil Pratt-Szeliga Fall 2010.
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
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.
Git A distributed version control system 23-Aug-15.
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: Part 1 Overview & Object Model These slides were largely cut-and-pasted from tutorial/, with some additions.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
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.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
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.
1 Introductory Notes on the Git Source Control Management Ric Holt, 8 Oct 2009.
Version control Using Git Version control, using Git1.
Git (Get) it done right! Practical Applied Version Control for Drupal site developers Peter Chen - Stanford School of Engineering Technical Webmaster.
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.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Introduction to Version Control with Git CSC/ECE 517, Fall 2014 A joint project of the CSC/ECE 517 staff, including Titus Barik, Gaurav Tungatkar, Govind.
Intro to Git presented by Brian K. Vagnini Hosted by.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
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.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Backing up a machine with git
Dr. Tanusri Bhattacharya
Version Control Systems
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to Version Control with Git
4 Version control (part 1)
Information Systems and Network Engineering Laboratory II
Source Control Systems
Version Control Systems
Git and GitHub primer.
Version Control with Subversion
A Simple Introduction to Git: a distributed version-control system
LECTURE 2: Software Configuration Management
L – Modeling and Simulating Social Systems with MATLAB
Version control, using Git
A Simple Introduction to Git: a distributed version-control system
CS5220 Advanced Topics in Web Programming Version Control with Git
Version Control System using Git
Version Control with Git and GitHub
Version Control Systems
Storing, Sending, and Tracking Files Recitation 2
Concurrent Version Control
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
Source Code Management
Version Control with git
LECTURE 3: Software Configuration Management
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Version Control with Git
Git started with git: 2018 edition
Version Control with Git and GitHub
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
How l learned to work with others instead of working around them.
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

Git is a Source Control Management Tool/Version Control System. Git Introduction Git is a Source Control Management Tool/Version Control System.

Source Control A means of recording what has happened to your source over time It gives you a (live) history.   Earlier SCM’s. RCS was an early Version Control System, it did things one file at a time Microsoft Visual Source Safe VCS, Subversion Liked RCS, used it a lot through the early 90’s, Also used VSS a lot, apparently it is likely to corrupt your data and is not recommended.

Source Control Uses When something breaks, it is possible to compare the current version, with an earlier version that worked, and find what where things went wrong. Especially if some time has passed, or someone else is now maintaining the project. A good way of locating bugs apparently, is to review sections where lots of changes have been made in the past. It is like another external memory aid, while you can probably remember what you changed this morning, what happened 2 weeks ago, less likely.

Git History Git was created by Linus Torvalds (with help), when the SCM they were using became unfree for use by the Linux Kernel Team. Its initial release was in a very short timeframe. It has been getting better ever since. It has become huge. Linus gave a talk about this and generally caned CVS, and Subversion. Transcript: https://gist.github.com/dukeofgaming/2150263

Comparisons Git is a Distributed SCM  Many of the older network SCM’s were centralized  When you clone a repository using Git you get most all of the history of the project and can see what happened (and why), and it is effectively a Clone, other people can clone yours and get the same stuff. You can share changes privately with other people. Whereas with say traditional Subversion, if you aren’t connected to the central repository you get almost nothing. RCS you really need to be working on the same filesystem. You were able to drop RCS files directly into CVS and they would work.

Comparisons Git creates a single (usually) directory called .git in the top level directory of the project, that has the entire history of the project within it. Cf. Subversion, which has a .svn directory for each directory in the project. (And they largely just contain the current server version of that directory)

For Single Users Source Control is recommended. Git happens to be very good.  

Git Storage Git is like a miniature filesystem. As Linus is a File System kind of person, Git was made in a File System manner It stores content, rather than changes to individual source files. With a structure on top of the content to link the content files back to their file names, and history. Each file that is checked in is stored in its entirety with some of the Git attributes. (Compressed with ZLib). With its name within the repository being the SHA1 hash of the uncompressed file These Loose files can be packed, which can use delta compression to give much tighter storage. Older SCM’s would store the changes as Diffs, and these diffs would be applied to the current version to get the older version. Works well with text files, less well with binary files. Renaming tended to be hard work Renaming of a file in Git, the file is removed and added with its new name, but having the same Hash gives it a fair indication the file was renamed.

Loose files To show the contents of the file git cat-file -p 58e2592d61bc45e8d8f6f7a046f30c09c7ec3e1a this is a test  File was called objects\58\e2592d61bc45e8d8f6f7a046f30c09c7ec3e1a  Can also use zlib extraction. openssl zlib -d -in e2592d61bc45e8d8f6f7a046f30c09c7ec3e1a blob 16 this is a test  pigz can also be used to view the raw file content (decompressed).  Also: openssl zlib -d -in e2592d61bc45e8d8f6f7a046f30c09c7ec3e1a | sha1sum gives 58e2592d61bc45e8d8f6f7a046f30c09c7ec3e1a

Cloning a Repository git clone https://hostname/path   You wind up with a clone of the original. You can check things out, etc. You can track changes to branches in the original source (origin)

Branching and Git Workflows This seems to be a promoted feature. Branches are very light weight and allows you to easily create new branches for tasks to work on, and then merge your new code in to the main branch (Master). Allows you to run multiple parallel branches. Handy if working on a task for next release, then get an urgent fix requirement to be applied to the current release. You do need to put some effort and practice into this to see how it works, and how it might be useful in your work flow. Usually the Master branch is called master.

Git Workflows https://www.atlassian.com/git/tutorials/comparing-workflows Centralized Workflow Feature Branch Workflow This seems fairly simple but useful. All features are made in a special branch just for that feature and merged into the master when complete. Gitflow Workflow Like feature branch but multi-level and more structured Forking Workflow Often used with Pull Request below

Pull Request Often used with GitHub to give work you have done on a public project to the maintainers. Clone the Project, make and test the changes locally (in a branch) Make a Fork of the public project which creates a writable fork of the project. Push your new branch to the Fork. Notify the maintainer, by creating a Pull Request. (GitHub has a Pull Request Mechanism) Which indicates the branch you have created (and want them to merge in) as well as the fork repository. There will then likely be some back and forth communications between the maintainer and yourself before they will accept your pull request. You don’t need to host a readable repository. Have read of pull requests, and was never really sure what/how.

GitHub Etc GitHub seems to be the best known, there are others.   GitHub seems to be the best known, there are others. Public hosting for source files in a Git Repository Also does private hosting in the same infrastructure

Commit Messages Found a recommended Commit Message format in Pro Git R2 pp156, which looks sensible  Single Line of up to about 50 characters which describes the changeset concisely. Blank Line More detailed explanation, including your motivation for the change and contrast its implementation with the previous behavior. A template (Originally by Tim Pope) is included in the book. Mentions, email-ability of the Change

Git Index/Staging Area Git has an index, or staging area. With some GUI Tools it is often not seen, but sometimes used. Can commit just a few files, (or even selected sections of files is an option) rather than the entire set of changed files Means you can stage changes, Break a set of disparate changes that you have made into a set of commits.

Misc Stuff Putting your .git folder elsewhere. https://stackoverflow.com/questions/4553530/setup-git-dir-and-git-work-tree-on-tortoisegit git init --separate-git-dir="PathToGitRepo"   Don’t Use Binary DFM files. (Mainly older Delphi’s) I seem to usually wind up with a Git Library, I could put my git repositories into a separate directory, and add it to that library, that way things like file history would include those files.

Tools (Gui) git gui Check in files, etc gitk Look at file history

Gnu/Linux Tools Git (on Windows) also includes a bunch of Gnu/Linux tools I don’t normally have them in the path but have a batch file that will put them in the path when I want them. Setgit.bat path C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;%PATH% Mine has no man pages, Use Internet. https://linux.die.net/  I use tar occasionally awk/gawk sometimes dd is good, but I tend to use a different one.  

Gnu/Linux Tools It has a bash shell, so can run bash scripts. It also has perl.   Some of the tools included require you to be running bash before they will execute (These tools have no extension, and are likely to be perl or bash scripts)

3rd Party Tools Atlassian’s Git client SourceTree ASP.net GIT web host: WebGitNet BFG Repo Cleaner to remove files you should not have put into GIT. Tortoise Git Libgit2 a C Library of all the Git Core Functions, which you can then embed in your applications.  

Books Pro Git V2, is downloadable from: https://git-scm.com/book/en/v2   Git Notes for Professionals: https://books.goalkicker.com/GitBook/ http://ftp.newartisans.com/pub/git.from.bottom.up.pdf https://medium.com/@willhayjr/the-architecture-and-history-of-git-a-distributed-version- control-system-62b17dd37742

Included Documentation There is a bunch of included html documentation for Git. (less so for the other common Gnu/Linux tools) C:\Program Files\Git\mingw64\share\doc\git-doc