SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Git
The stupid content tracker basics.


                            Piotr Benetkiewicz
                            AIS.PL
Distributed
● entire(fully functional) repository on your
  disk
● remote repositories sync

● git init
● git clone xxx://remote.repo/
    ○ xxx: ssh, http, filesystem...
    ○ common: ssh -> keys authentication
●   git clone http://piotr.vpn.ais.pl/git/[login].git
Configuration
●   ~/.gitconfig, .git/ in local repo
●   various git commands
●   .gitignore in local repo root (regexps)
●   exclude file in .git/info/ (not versioned)
(very) basic workflow
●   git clone xxx://remote.repo/ (one time)
●   git pull
●   hack, hack, hack
●   git status
●   git add file_that_i_hacked.cs
●   git commit -m "add feature"
●   git log
●   git push origin master
git add
● index = staging = "the next patch"
● not all modified/added files have to be
  included in the next commit
● untracked files appear in all branches

● git add .
● git commit -a
git commit

                  changed1.cs   changed2.cs




          SHA1    changed3.cs   changed4.cs
                  diff          diff




 ef0ab9          571d59          9c4bb5



 Time
HEAD, master, branch_name...
Pointers... HEAD~2 <- HEAD^ <- HEAD




                               Image by http://marklodato.github.com
undo
change foo - git checkout foo
git add foo - git reset foo
git commit foo - git reset --[hard/soft] HEAD^
typo, forgot sth? - git commit --amend
git branch
● light
● quick
● branch per feature

git   branch branch_name (create)
git   checkout branch_name (switch)
git   checkout -b branch_name (create and switch)
git   push origin branch (push local branch to remote)
git   branch lbranch origin/rbranch (map remote to local)
git merge
git merge feature_branch

create new (one) commit containing all
changes (one or more commits) from the
branch being merged
conflict
● merged files end up in staging area
● git explicitly says which files contain
  unresolved conflicts after merge
● user manually resolves conflicts
● user adds resolved files to staging
rebase
git rebase master
"play" my commit history on top of the given
branch
                      or
change my point of branching
rebase (cont.)

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git Basics Philips
Git Basics PhilipsGit Basics Philips
Git Basics Philips
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Git basics
Git basicsGit basics
Git basics
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git vol 2
Git vol 2Git vol 2
Git vol 2
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 

Ähnlich wie Introduction to GIT

Ähnlich wie Introduction to GIT (20)

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
 
Git
GitGit
Git
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
Git
GitGit
Git
 
Git github
Git githubGit github
Git github
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git training v10
Git training v10Git training v10
Git training v10
 
Advanted git
Advanted git Advanted git
Advanted git
 
Git training
Git trainingGit training
Git training
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git
GitGit
Git
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 

Mehr von Piotr Benetkiewicz

Mehr von Piotr Benetkiewicz (6)

Deep dive into Fastly
Deep dive into FastlyDeep dive into Fastly
Deep dive into Fastly
 
So, you wanna build a SSO
So, you wanna build a SSOSo, you wanna build a SSO
So, you wanna build a SSO
 
.NET compiler platform codename Roslyn
.NET compiler platform codename Roslyn.NET compiler platform codename Roslyn
.NET compiler platform codename Roslyn
 
Automatic system tests of web applications
Automatic system tests of web applicationsAutomatic system tests of web applications
Automatic system tests of web applications
 
Linq and Orcas
Linq and OrcasLinq and Orcas
Linq and Orcas
 
NET flow
NET flowNET flow
NET flow
 

Kürzlich hochgeladen

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Introduction to GIT

  • 1. Git The stupid content tracker basics. Piotr Benetkiewicz AIS.PL
  • 2. Distributed ● entire(fully functional) repository on your disk ● remote repositories sync ● git init ● git clone xxx://remote.repo/ ○ xxx: ssh, http, filesystem... ○ common: ssh -> keys authentication ● git clone http://piotr.vpn.ais.pl/git/[login].git
  • 3. Configuration ● ~/.gitconfig, .git/ in local repo ● various git commands ● .gitignore in local repo root (regexps) ● exclude file in .git/info/ (not versioned)
  • 4. (very) basic workflow ● git clone xxx://remote.repo/ (one time) ● git pull ● hack, hack, hack ● git status ● git add file_that_i_hacked.cs ● git commit -m "add feature" ● git log ● git push origin master
  • 5. git add ● index = staging = "the next patch" ● not all modified/added files have to be included in the next commit ● untracked files appear in all branches ● git add . ● git commit -a
  • 6. git commit changed1.cs changed2.cs SHA1 changed3.cs changed4.cs diff diff ef0ab9 571d59 9c4bb5 Time
  • 7. HEAD, master, branch_name... Pointers... HEAD~2 <- HEAD^ <- HEAD Image by http://marklodato.github.com
  • 8. undo change foo - git checkout foo git add foo - git reset foo git commit foo - git reset --[hard/soft] HEAD^ typo, forgot sth? - git commit --amend
  • 9. git branch ● light ● quick ● branch per feature git branch branch_name (create) git checkout branch_name (switch) git checkout -b branch_name (create and switch) git push origin branch (push local branch to remote) git branch lbranch origin/rbranch (map remote to local)
  • 10. git merge git merge feature_branch create new (one) commit containing all changes (one or more commits) from the branch being merged
  • 11. conflict ● merged files end up in staging area ● git explicitly says which files contain unresolved conflicts after merge ● user manually resolves conflicts ● user adds resolved files to staging
  • 12. rebase git rebase master "play" my commit history on top of the given branch or change my point of branching