SU Development Forum Introduction to Git - Save your projects!

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

om om GIT - Tips & Tricks / git.dvcs git-tips.com
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.
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
Version control Using Git 1Version control, using Git.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Version control Using Git Version control, using Git1.
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
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Team 708 – Hardwired Fusion Created by Nam Tran 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.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
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.
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.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
Installing git In Linux: sudo apt-get install git In Windows: download it from run the setuphttp://git-scm.com/download/win.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Introduction to Git Thomas.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
Jun-Ru Chang Introduction GIT Jun-Ru Chang
GitHub A web-based Git repository hosting service.
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 for bzr users October Aurélien Gâteau An attempt at making you comfortable when you have to work with a git repository.
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Basics of GIT for developers and system administrators
.git git-scm.com free and open source distributed version control system p.s. for beginners…
CS5220 Advanced Topics in Web Programming Version Control with Git
M.Sc. Juan Carlos Olivares Rojas
Information Systems and Network Engineering Laboratory II
Primož Gabrijelčič Git for Programmers Primož Gabrijelčič
Git and GitHub primer.
11 Version control (part 2)
CReSIS Git Tutorial.
Git Practice walkthrough.
Setting up Git, GitBash, and GitHub
Version control, using Git
File Version Control System
CS5220 Advanced Topics in Web Programming Version Control with Git
Macaualy2 Workshop Berkeley 2017
An introduction to version control systems with Git
Version Control with Git accelerated tutorial for busy academics
Distributed Version Control with git
Akshay Narayan git up to speed with RCS Akshay Narayan
An introduction to version control systems with Git
Version Control with git
Setting up Git, GitBash, and GitHub
An introduction to version control systems with Git
Version control with Git
Git CS Fall 2018.
Version Control System - Git
Version control with Git
Introduction to Git and GitHub
GitHub and Git.
Version Control with Git and GitHub
GitHub 101 Using Github and Git for Source Control
Git Introduction.
Introduction to Git and Github
Git GitHub.
Introduction to The Git Version Control System
Advanced Git for Beginners
Presentation transcript:

SU Development Forum Introduction to Git - Save your projects! Use of standards like OAIS Auteur: Rémi Ducceschi Supervisor: Francis Klumb 2018-01-26

Git – Distributed Version Control System What is it? Created by Linus Torvalds in 2005 For Linux kernel Tool – to be integrated in your workflow Manage your project files Save them on a server (security) Keep a track of the modifications (history) Ease team working

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN No need for server Remote Local WARNING: No data duplication !

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN SVN style – mono user Remote Local

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN SVN style – multi user Remote Local

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN Distributed: peer to peer Remote Local

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN Distributed: multi remote Remote Local

Git – Distributed Version Control System Distributed? Distributed: main difference with SVN Distributed: Usual Open Source workflow Remote Local

Git – Concepts What is a commit? Commits What is a commit? Contains the state of all the files at one moment Contains a message explaining the reasons of the changes Contains the the whole history that leads to it Commits are organized in a graph 1 or more parents (history) 1 or more children (future) Commits have name A hash: 76e22ab887fe24de6a7b3d19809af392de3036e6 Will be simplified in this presentation

Git – Concepts Graph

Git – Concepts References How to organize the commits? Use references: Tag → direct pointer to a commit (label) Branch → dynamic pointer Points to one commit Moves to the most recent commit dynamically Default branch = master HEAD → current position in the tree

Git – Concepts References How to move in the graph? Git checkout: to commit name (ad65ert5gd12) to relative position (HEAD~2) to tag to branch

Git – Setup your environment Install Git Windows Install Git for Windows https://git-scm.com/downloads Do not use the CMF version: not up to date Min version to install: 2.16 Some UI exists (Tortoise Git, Github Desktop) CLI is easy to learn See the CheatSheet → 5 commands for basics CLI is way more powerful You will need CLI at one point anyway Linux: yum install git

Git – Setup your environment Basics Tell git who you are git config --global user.name "Rémi Ducceschi" git config --global user.email "remi.ducceschi@cern.ch" Change default editor (nano) git config --global core.editor "C:/Program\ Files/Notepad++/notepad++.exe -multiInst -notabbar -nosession - noPlugin" Colors (on by default) git config --global color.ui true Stored in ~/.gitconfig Can be overwritten in project by adding a .gitconfig

Git[lab] – Workflow From editing, publishing to integrating the code Create a branch One branch per feature Edit files Commit your changes Do it several times To save your work (end of the day, lunch time…) To separate minor states of development Push to remote Create a Pull Request (PR) / Merge Request

Git[lab] – Workflow From editing, publishing to integrating the code Create a branch One branch per feature Edit files Commit your changes Do it several times To save your work (end of the day, lunch time…) To separate minor states of development Push to remote Create a Pull Request (PR) / Merge Request

Git[lab] – Workflow Create a branch Checkout on master and update it git checkout master git pull Create your branch and checkout on it git checkout -b my_branch You can push your branch now Even without any modifications git push --set-upstream origin my_branch

Git[lab] – Workflow From editing, publishing to integrating the code Create a branch One branch per feature Edit files Commit your changes Do it several times To save your work (end of the day, lunch time…) To separate minor states of development Push to remote Create a Pull Request (PR) / Merge Request

Git[lab] – Workflow How to commit A bit of theory: 3 states File edition Commit edition Publication

Git[lab] – Workflow How to commit Edit files git status to see changes Add the changes git add file1 file2… Commit git commit

Git[lab] – Workflow From editing, publishing to integrating the code Create a branch One branch per feature Edit files Commit your changes Do it several times To save your work (end of the day, lunch time…) To separate minor states of development Push to remote Create a Pull Request (PR) / Merge Request

Git[lab] – Workflow How to publish First we update the branch git pull Then we push git push git push --set-upstream origin my_branch Needed if the branch has never been pushed

Git[lab] – Workflow From editing, publishing to integrating the code Create a branch One branch per feature Edit files Commit your changes Do it several times To save your work (end of the day, lunch time…) To separate minor states of development Push to remote Create a Pull Request (PR) / Merge Request

Git[lab] – Workflow How to Pull request (PR)

Git[lab] – Workflow How to Pull request (PR)

Git[lab] – Workflow How to Pull request (PR)

Git[lab] – Workflow How to Pull request (PR) With good repository setup Click merge when ready!

Git - Conclusion I didn’t talked about merge You shouldn’t merge by hand! Only merge via Pull Requests Except rare occasion Rebase only! Advanced git possibilities Rewrite history Reflogs …

Git – External links Very useful! Learn git from basics to expert https://learngitbranching.js.org/ Customize your environment with aliases https://git-scm.com/book/tr/v2/Git-Basics-Git- Aliases

Questions