SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
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.)

Mais conteúdo relacionado

Mais procurados

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
Nick Quaranto
 

Mais procurados (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
 

Semelhante a Introduction to GIT

Git tech talk
Git tech talkGit tech talk
Git tech talk
razasayed
 
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
Brian K. Vagnini
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
Terry Wang
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang
 

Semelhante a 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
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
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
 

Mais de 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
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your 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 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

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