SlideShare a Scribd company logo
1 of 28
Introduction to
GIT Versioning
STACKIT Community
ACH. JAILANI
GIT
“GIT adalah perangkat lunak pengontrol versi atau proyek
manajemen kode perangkat lunak”
https://id.wikipedia.org/wiki/Git
Version Control System (VCS)
STACKIT Community
Illustration
File
Using GIT
Rev 1 Rev 2 Rev 3 Rev 4 Rev 5 Rev N
File
Without GIT
Ver 1 Ver 2 Ver 3 Ver 3 Ver 4 Ver 5
STACKIT Community
Development of GIT
Linus Torvalds
STACKIT Community
Born December 28, 1969
Helsinki, Finland
Accopation Software Engineer
HISTORY
Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a
proprietary source-control management (SCM) system that they had formerly used to maintain the project. The
copyright holder of BitKeeper, Larry McVoy, had withdrawn free use of the product after claiming that Andrew
Tridgell had created SourcePuller by reverse engineering the BitKeeper protocols.
Linus Torvalds wanted a distributed system that he could use like BitKeeper, but none of the available free
systems met his needs. Torvalds cited an example of a source-control management system needing 30 seconds
to apply a patch and update all associated metadata, and noted that this would not scale to the needs of Linux
kernel development, where synchronizing with fellow maintainers could require 250 such actions at once. For his
design criteria, he specified that patching should take no more than three seconds, and added three more points:
STACKIT Community
Platform Repository
STACKIT Community
List of Topics
● Installation
● Creating and getting repository
● Setting Username and Email
● Git workflow
● Add and Commit
● Learning about a command
● Browsing the history
● Working with remote
● Push
● Branch and Marge
STACKIT Community
Installation
● Windows
https://git-scm.com/download/win
● Linux
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
or
sudo apt-get install git
By default, git has been installed for linux OS
STACKIT Community
Getting and Creating Project
git init
git clone <repository>
git clone <repository> <new_dir>
> git clone https://github.com/stackit/my-first-project
STACKIT Community
GIT Options
git : displays all git commands
--version : Prints the Git suite version that the git program came from.
--help : Prints the synopsis and a list of the most commonly used commands. If the option --all or -a is given then all
available commands are printed. If a Git command is named this option will bring up the manual page for that command.
STACKIT Community
Setting name & email
You need to set who you are *before* creating any commit. That will allows
commits to have the right author name and email associated to them.
STACKIT Community
● Global identity
git config --global user.name ” Oliver Queen”
git config --global user.email “example@gmail.com”
● Single repository
git config user.name ”Oliver Queen”
git config user.email “example@gmail.com”
git config --list
STACKIT Community
Remove name & email
git config --global --unset-all user.name
git config --global --unset-all user.email
STACKIT Community
Change name & email
git config --global --replace-all user.name
git config --global --replace-all user.email
Git workflow
STACKIT Community
Add & Commit
GIT Add
STACKIT Community
git add .
git add <filename>
git add *
git add *.<extension>
GIT Commit
git commit –m “Message”
> git commit –m “Add: adding my first page”
Learning about a command
To get more information about git command – details about what command
does, use the –help option or the help command.
> git status --help
> git help status
Or simply
> git status -h
STACKIT Community
> git log
> git log -2
Browsing the history
● Regular git log
● Oneline log
STACKIT Community
> git log --oneline
you can assign an alias
> git config --global alias.lol "log --oneline”
> git lol
> git log [no-commit]
> git log
● Using commit number
> git log [file-name.extension]
> git log index.html
● Log in particular file
> git log --author=“author-name”
> git log --author=”stackit”
● Log author
Cancel revision
● Git checkout [file-name] => before staged and commit
> git checkout index.html
● Git reset [file-name] => after staged
> git reset index.html
> git checkout index.html
● Git reset --soft HEAD~
> git reset --soft HEAD~
> git reset index.html
> git checkout index.html
Teamwork with platform repository
STACKIT Communitysource : https://www.nobledesktop.com
Github page
STACKIT Community
Create repository
STACKIT Community
git remote add <remote_name> <remote_url>
> git remote add origin https://github.com/stackit/gitfund.git
Working with remotes
● Create remote
● Check existing remote
STACKIT Community
-
List all the existing remotes associated with this repository:
> git remove
List all the existing remotes associated with this repository in detail
including the fetch and push URLs:
> git remote –verbose
Or simply
> git remote --v
git remote set-url <remote_name> <remote_url>
> git remote set-url origin https://github.com/stackit/gitfund.git
● Changing remote URL
git push [remote-name] --delete [branch-name]
> git push origin –delete develop
● Deleting a remote branch
git remote rename [old-remote-name] [new-remote-name]
> git remote rename origin develop
● Renaming a remote
git remote remove [remote-name]
> git remote remove origin
● Removing a remote
STACKIT Community
Pushing to github
git push -u [remote-name] [branch-
name]
> git push -u origin master
Branch & Merge
STACKIT Community
git branch [branch-name]
> git branch login
Branch
Create branch
git checkout [branch-name]
> git checkout master
Switch to another branch
git branch -d [branch-name]
> git branch -d login
Delete branch
Merge
git merge [branch-name]
> git merge login
Or
git merge [branch-one] [branch-two]
> git merge master login
Git merge
THANK YOU!
@STACKIT

More Related Content

What's hot

Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubRick Umali
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentalsRajKharvar
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践Terry Wang
 
Git Introduction
Git IntroductionGit Introduction
Git IntroductionGareth Hall
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
 
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!Stennie Steneker
 
GIT - DUG Antwerp
GIT - DUG AntwerpGIT - DUG Antwerp
GIT - DUG AntwerpKrimson
 
Crash course in git and github
Crash course in git and githubCrash course in git and github
Crash course in git and githubMithun Shanbhag
 

What's hot (19)

Basic Git Tutorial
Basic Git TutorialBasic Git Tutorial
Basic Git Tutorial
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git 101
Git 101Git 101
Git 101
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
 
Git: Git'ing the Basic
Git: Git'ing the BasicGit: Git'ing the Basic
Git: Git'ing the Basic
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
 
Advanted git
Advanted git Advanted git
Advanted git
 
GIT - DUG Antwerp
GIT - DUG AntwerpGIT - DUG Antwerp
GIT - DUG Antwerp
 
Git Basic
Git BasicGit Basic
Git Basic
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
Crash course in git and github
Crash course in git and githubCrash course in git and github
Crash course in git and github
 

Similar to Introduction to GIT versioning

Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheetLam Hoang
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践Terry Wang
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptxgdscuds
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-trainingEric Guo
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Ashok Kumar
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 

Similar to Introduction to GIT versioning (20)

Git & GitHub
Git & GitHubGit & GitHub
Git & GitHub
 
Git & G
Git & GGit & G
Git & G
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Git
GitGit
Git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git
GitGit
Git
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git
GitGit
Git
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 

Recently uploaded

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 

Recently uploaded (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Introduction to GIT versioning

  • 1. Introduction to GIT Versioning STACKIT Community ACH. JAILANI
  • 2. GIT “GIT adalah perangkat lunak pengontrol versi atau proyek manajemen kode perangkat lunak” https://id.wikipedia.org/wiki/Git Version Control System (VCS) STACKIT Community
  • 3. Illustration File Using GIT Rev 1 Rev 2 Rev 3 Rev 4 Rev 5 Rev N File Without GIT Ver 1 Ver 2 Ver 3 Ver 3 Ver 4 Ver 5 STACKIT Community
  • 4. Development of GIT Linus Torvalds STACKIT Community Born December 28, 1969 Helsinki, Finland Accopation Software Engineer
  • 5. HISTORY Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a proprietary source-control management (SCM) system that they had formerly used to maintain the project. The copyright holder of BitKeeper, Larry McVoy, had withdrawn free use of the product after claiming that Andrew Tridgell had created SourcePuller by reverse engineering the BitKeeper protocols. Linus Torvalds wanted a distributed system that he could use like BitKeeper, but none of the available free systems met his needs. Torvalds cited an example of a source-control management system needing 30 seconds to apply a patch and update all associated metadata, and noted that this would not scale to the needs of Linux kernel development, where synchronizing with fellow maintainers could require 250 such actions at once. For his design criteria, he specified that patching should take no more than three seconds, and added three more points: STACKIT Community
  • 7. List of Topics ● Installation ● Creating and getting repository ● Setting Username and Email ● Git workflow ● Add and Commit ● Learning about a command ● Browsing the history ● Working with remote ● Push ● Branch and Marge STACKIT Community
  • 8. Installation ● Windows https://git-scm.com/download/win ● Linux sudo add-apt-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git or sudo apt-get install git By default, git has been installed for linux OS STACKIT Community
  • 9. Getting and Creating Project git init git clone <repository> git clone <repository> <new_dir> > git clone https://github.com/stackit/my-first-project STACKIT Community
  • 10. GIT Options git : displays all git commands --version : Prints the Git suite version that the git program came from. --help : Prints the synopsis and a list of the most commonly used commands. If the option --all or -a is given then all available commands are printed. If a Git command is named this option will bring up the manual page for that command. STACKIT Community
  • 11. Setting name & email You need to set who you are *before* creating any commit. That will allows commits to have the right author name and email associated to them. STACKIT Community
  • 12. ● Global identity git config --global user.name ” Oliver Queen” git config --global user.email “example@gmail.com” ● Single repository git config user.name ”Oliver Queen” git config user.email “example@gmail.com” git config --list STACKIT Community
  • 13. Remove name & email git config --global --unset-all user.name git config --global --unset-all user.email STACKIT Community Change name & email git config --global --replace-all user.name git config --global --replace-all user.email
  • 15. Add & Commit GIT Add STACKIT Community git add . git add <filename> git add * git add *.<extension> GIT Commit git commit –m “Message” > git commit –m “Add: adding my first page”
  • 16. Learning about a command To get more information about git command – details about what command does, use the –help option or the help command. > git status --help > git help status Or simply > git status -h STACKIT Community
  • 17. > git log > git log -2 Browsing the history ● Regular git log ● Oneline log STACKIT Community > git log --oneline you can assign an alias > git config --global alias.lol "log --oneline” > git lol > git log [no-commit] > git log ● Using commit number > git log [file-name.extension] > git log index.html ● Log in particular file > git log --author=“author-name” > git log --author=”stackit” ● Log author
  • 18. Cancel revision ● Git checkout [file-name] => before staged and commit > git checkout index.html ● Git reset [file-name] => after staged > git reset index.html > git checkout index.html ● Git reset --soft HEAD~ > git reset --soft HEAD~ > git reset index.html > git checkout index.html
  • 19. Teamwork with platform repository STACKIT Communitysource : https://www.nobledesktop.com
  • 22. git remote add <remote_name> <remote_url> > git remote add origin https://github.com/stackit/gitfund.git Working with remotes ● Create remote ● Check existing remote STACKIT Community - List all the existing remotes associated with this repository: > git remove List all the existing remotes associated with this repository in detail including the fetch and push URLs: > git remote –verbose Or simply > git remote --v
  • 23. git remote set-url <remote_name> <remote_url> > git remote set-url origin https://github.com/stackit/gitfund.git ● Changing remote URL git push [remote-name] --delete [branch-name] > git push origin –delete develop ● Deleting a remote branch git remote rename [old-remote-name] [new-remote-name] > git remote rename origin develop ● Renaming a remote git remote remove [remote-name] > git remote remove origin ● Removing a remote STACKIT Community
  • 24. Pushing to github git push -u [remote-name] [branch- name] > git push -u origin master
  • 26. git branch [branch-name] > git branch login Branch Create branch git checkout [branch-name] > git checkout master Switch to another branch git branch -d [branch-name] > git branch -d login Delete branch
  • 27. Merge git merge [branch-name] > git merge login Or git merge [branch-one] [branch-two] > git merge master login Git merge