SlideShare a Scribd company logo
Introduction to Git
By John Troon
What is Git?
● Version Control System (VCS)
it's a VCS designed to handle very large projects
with speed and effciency.
● Distributed Source Code management
– Every Git working directory is a full-fleged
repository with full version tracking capabilities, not
dependent on network access or a central server.
Why Git
● Work offline
● Branching (made easy)
● Distributed (when back online)
● Clean (easy project tracking)
Install Git
● Debian based:
– `apt-get install git-core`
● Mac Ports:
– `port install git-core`
● RPM Based:
– `yum install git-core`
● Arch Linux:
– `pacman -S git-core`
Build Git from Source
● Download and uncompress the tar.gz source
– `tar xfz git-version.tar.gz
– `cd git-version`
● Make
– `make prefix=/usr/local all`
– `sudo make prefix=/usr/local install`
– `git --version`
Configure Git
● General Global Config
– `git config --global user.name “John Troon”
– `git config –global email 'troon@linuxmail.org'
– `git config –list`
● Alias:
– `git config –global alias.sts status`
● White Space diff
– `git config –global apply.whitespace nowarn`
Basic Git Commands
● Initialize
– `git init`
– `tree .git`
● Edit, Stage, Commit
– `git add .` or `git add filename`
– `git status`
– `git commit -m “First commit”` or `git commit -a -v`
– `git lsfiles` view tracked files
– `git rm unwantedFile` Remove files not to track.
Git Log
● View Git history with Sha1 hashes
– `git log`
– `git reflog`
● ASCII Graph
– `git log --stat`
● View Actual Difference
– `git log -p`
● View particular changes on a file
– `git log –patch Filename`
● Search Git Logs
– `git log -S 'string'
Branches
● Why Branch?
– When working on new experimental features.
– By default, you will be working on the master branch.
● Branch and switch to the new branch….
– `git branch new-feature`
– `git branch`
– `git checkout new-feature`
● Simple trick..
– Create and switch to a new brach based on the master repository.
– `git checkout -b new-feature master`
Merge Changes from a Branch
● Update Branch with new changes on Master
– `git rebase master` (still on the new-feature branch)
● Mearge Master with the new Branch
– Checkout to master `git checkout master`
– Check diffrecence `git diff master new-feature`
– Everything okay, merge! `git merge new-feature`
● Reset (Shit happens)
– `git rest --hard ORIG_HEAD`
● Conflict During Merge
– You'll have to read the error(s) and resolve them manually.
Remote Repository
● SSH and HTTPS access
– For demos, I'll be using github.com
– Create an account, SSH key pairs and a repository.
● Working……
– `git clone remote-project`
– `git commit -a -v` (after making changes…)
– `git push` (submit changes to remot repo)
– `git pull` (get changes from remote server)
– `git pull –rebase origin master` It's good to rebase instead of pull
since you will wind up with lot of “merge commit”.
Cool Resources
● gbrt
● Smart-pull
● Gitk
● Git working flow
– Centralised workflow
– Feature Branch workflow
– GitFlow workflow
– Forking Workflow
Questions?
John Troon
Email: troon@linuxmail.org
Twitter: @johntroony

More Related Content

What's hot

Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
ColCh
 
Auto infra with_foreman_katello
Auto infra with_foreman_katelloAuto infra with_foreman_katello
Auto infra with_foreman_katello
Sachin Ghai
 
DIEMS Repository Server - GitLab
DIEMS Repository Server - GitLabDIEMS Repository Server - GitLab
DIEMS Repository Server - GitLab
Mayur Deshmukh
 
Machinekit - Machinekit Basics Workshop
Machinekit - Machinekit Basics WorkshopMachinekit - Machinekit Basics Workshop
Machinekit - Machinekit Basics Workshop
Alexander Rössler
 
Git hooks for front end developers
Git hooks for front end developersGit hooks for front end developers
Git hooks for front end developers
Bradley Gore
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
Joerg Henning
 
Managing your SaltStack Minions with Foreman
Managing your SaltStack Minions with ForemanManaging your SaltStack Minions with Foreman
Managing your SaltStack Minions with Foreman
Stephen Benjamin
 
Machinekit - Build Real Time Systems with Python
Machinekit - Build Real Time Systems with PythonMachinekit - Build Real Time Systems with Python
Machinekit - Build Real Time Systems with Python
Alexander Rössler
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
Mukul Malhotra
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, too
inovex GmbH
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
NETWAYS
 
OSDC 2015: Stephen Benjamin | Foreman in Your Data Center
OSDC 2015: Stephen Benjamin | Foreman in Your Data CenterOSDC 2015: Stephen Benjamin | Foreman in Your Data Center
OSDC 2015: Stephen Benjamin | Foreman in Your Data Center
NETWAYS
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVM
takezoe
 
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
Kamil Czekirda
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
Lingvokot
 
RancherOS - The perfect place to run Docker
RancherOS - The perfect place to run DockerRancherOS - The perfect place to run Docker
RancherOS - The perfect place to run Docker
Saputro Aryulianto
 
Caching in Docker - the hardest thing in computer science
Caching in Docker - the hardest thing in computer scienceCaching in Docker - the hardest thing in computer science
Caching in Docker - the hardest thing in computer science
Jarek Potiuk
 
Deploying RDO OpenStack with a pair of plugins
Deploying RDO OpenStack with a pair of pluginsDeploying RDO OpenStack with a pair of plugins
Deploying RDO OpenStack with a pair of plugins
Dominic Cleal
 

What's hot (20)

Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
Auto infra with_foreman_katello
Auto infra with_foreman_katelloAuto infra with_foreman_katello
Auto infra with_foreman_katello
 
DIEMS Repository Server - GitLab
DIEMS Repository Server - GitLabDIEMS Repository Server - GitLab
DIEMS Repository Server - GitLab
 
Machinekit - Machinekit Basics Workshop
Machinekit - Machinekit Basics WorkshopMachinekit - Machinekit Basics Workshop
Machinekit - Machinekit Basics Workshop
 
Git hooks
Git hooksGit hooks
Git hooks
 
Git hooks for front end developers
Git hooks for front end developersGit hooks for front end developers
Git hooks for front end developers
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
Managing your SaltStack Minions with Foreman
Managing your SaltStack Minions with ForemanManaging your SaltStack Minions with Foreman
Managing your SaltStack Minions with Foreman
 
Machinekit - Build Real Time Systems with Python
Machinekit - Build Real Time Systems with PythonMachinekit - Build Real Time Systems with Python
Machinekit - Build Real Time Systems with Python
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, too
 
11 git version control
11 git version control11 git version control
11 git version control
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
 
OSDC 2015: Stephen Benjamin | Foreman in Your Data Center
OSDC 2015: Stephen Benjamin | Foreman in Your Data CenterOSDC 2015: Stephen Benjamin | Foreman in Your Data Center
OSDC 2015: Stephen Benjamin | Foreman in Your Data Center
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVM
 
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015FreeBSD preseed installation (PXE) AsiaBSDCon 2015
FreeBSD preseed installation (PXE) AsiaBSDCon 2015
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
RancherOS - The perfect place to run Docker
RancherOS - The perfect place to run DockerRancherOS - The perfect place to run Docker
RancherOS - The perfect place to run Docker
 
Caching in Docker - the hardest thing in computer science
Caching in Docker - the hardest thing in computer scienceCaching in Docker - the hardest thing in computer science
Caching in Docker - the hardest thing in computer science
 
Deploying RDO OpenStack with a pair of plugins
Deploying RDO OpenStack with a pair of pluginsDeploying RDO OpenStack with a pair of plugins
Deploying RDO OpenStack with a pair of plugins
 

Viewers also liked

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
Linux: Hardware Settings
Linux: Hardware SettingsLinux: Hardware Settings
Linux: Hardware Settings
John Ombagi
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
John Ombagi
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and rebootAcácio Oliveira
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared librariesAcácio Oliveira
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
Archana Chandrasekharan
 

Viewers also liked (6)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux: Hardware Settings
Linux: Hardware SettingsLinux: Hardware Settings
Linux: Hardware Settings
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 

Similar to Introduction to Git

Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Amit Mathur
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
Adam Culp
 
Svn to-git
Svn to-gitSvn to-git
Svn to-git
jwausle
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Advanted git
Advanted git Advanted git
Advanted git
Sahil Gupta
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of GitWayne Chen
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
Cory Webb
 
Git tech talk
Git tech talkGit tech talk
Git tech talkrazasayed
 
Git
GitGit
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 

Similar to Introduction to Git (20)

Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Svn to-git
Svn to-gitSvn to-git
Svn to-git
 
Git
GitGit
Git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Advanted git
Advanted git Advanted git
Advanted git
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of Git
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
版本控制Git
版本控制Git版本控制Git
版本控制Git
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 
Git
GitGit
Git
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
git-flow R3Labs
git-flow R3Labsgit-flow R3Labs
git-flow R3Labs
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

Introduction to Git

  • 2. What is Git? ● Version Control System (VCS) it's a VCS designed to handle very large projects with speed and effciency. ● Distributed Source Code management – Every Git working directory is a full-fleged repository with full version tracking capabilities, not dependent on network access or a central server.
  • 3. Why Git ● Work offline ● Branching (made easy) ● Distributed (when back online) ● Clean (easy project tracking)
  • 4. Install Git ● Debian based: – `apt-get install git-core` ● Mac Ports: – `port install git-core` ● RPM Based: – `yum install git-core` ● Arch Linux: – `pacman -S git-core`
  • 5. Build Git from Source ● Download and uncompress the tar.gz source – `tar xfz git-version.tar.gz – `cd git-version` ● Make – `make prefix=/usr/local all` – `sudo make prefix=/usr/local install` – `git --version`
  • 6. Configure Git ● General Global Config – `git config --global user.name “John Troon” – `git config –global email 'troon@linuxmail.org' – `git config –list` ● Alias: – `git config –global alias.sts status` ● White Space diff – `git config –global apply.whitespace nowarn`
  • 7. Basic Git Commands ● Initialize – `git init` – `tree .git` ● Edit, Stage, Commit – `git add .` or `git add filename` – `git status` – `git commit -m “First commit”` or `git commit -a -v` – `git lsfiles` view tracked files – `git rm unwantedFile` Remove files not to track.
  • 8. Git Log ● View Git history with Sha1 hashes – `git log` – `git reflog` ● ASCII Graph – `git log --stat` ● View Actual Difference – `git log -p` ● View particular changes on a file – `git log –patch Filename` ● Search Git Logs – `git log -S 'string'
  • 9. Branches ● Why Branch? – When working on new experimental features. – By default, you will be working on the master branch. ● Branch and switch to the new branch…. – `git branch new-feature` – `git branch` – `git checkout new-feature` ● Simple trick.. – Create and switch to a new brach based on the master repository. – `git checkout -b new-feature master`
  • 10. Merge Changes from a Branch ● Update Branch with new changes on Master – `git rebase master` (still on the new-feature branch) ● Mearge Master with the new Branch – Checkout to master `git checkout master` – Check diffrecence `git diff master new-feature` – Everything okay, merge! `git merge new-feature` ● Reset (Shit happens) – `git rest --hard ORIG_HEAD` ● Conflict During Merge – You'll have to read the error(s) and resolve them manually.
  • 11. Remote Repository ● SSH and HTTPS access – For demos, I'll be using github.com – Create an account, SSH key pairs and a repository. ● Working…… – `git clone remote-project` – `git commit -a -v` (after making changes…) – `git push` (submit changes to remot repo) – `git pull` (get changes from remote server) – `git pull –rebase origin master` It's good to rebase instead of pull since you will wind up with lot of “merge commit”.
  • 12. Cool Resources ● gbrt ● Smart-pull ● Gitk ● Git working flow – Centralised workflow – Feature Branch workflow – GitFlow workflow – Forking Workflow