SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Ignorieren
versionierter!Dateien
in#Git
©"Stephan"Partzsch,"2015 1
Ignorieren(neuer(Dateien
• .gitignore"System"für"generellen"Ausschluss"neuer"Dateien
• Automa7sch"generierte"Log9Dateien"oder"Build9Dateien
• .gitignore"funk7oniert"nicht"bei"versionierten"Dateien
©"Stephan"Partzsch,"2015 2
Ignorieren(versionierter(Dateien
!!assume!unchanged
• Gedacht)um)ineffiziente)Dateisysteme)zu)entlasten
• Einstellung)wird)in)einigen)Fällen)überschrieben
• git reset --hard
• Pull)neuerer)Version)aus)dem)Remote@Repository)
©"Stephan"Partzsch,"2015 3
Ignorieren(versionierter(Dateien
!!assume!unchanged
• Gedacht)um)ineffiziente)Dateisysteme)zu)entlasten
• Einstellung)wird)in)einigen)Fällen)überschrieben
• git reset --hard
• Pull)neuerer)Version)aus)dem)Remote@Repository)
©"Stephan"Partzsch,"2015 4
Neuer%Versuch!
©"Stephan"Partzsch,"2015 5
Ignorieren(versionierter(Dateien
!!skip!worktree
• Normale)Git-Rou0nen)bleiben)erhalten
• Ignoriert)bewusst)Änderungen)im)Worktree
• Einstellung)wird)nicht)überschrieben!!!
©"Stephan"Partzsch,"2015 6
Ignorieren(versionierter(Dateien
!!skip!worktree
• !Stashen*der*Dateien*klappt*nicht,*wenn*Einstellung*ak8v*ist!
• Einstellung*für*betroffene*Dateien*müssen*vorher*manuell*
deak8viert*werden
©"Stephan"Partzsch,"2015 7
Anwendung
©"Stephan"Partzsch,"2015 8
Versionierte)Datei)ignorieren
git update-index --skip-worktree <file>
©"Stephan"Partzsch,"2015 9
Versionierte)Datei)wieder&berücksich-gen
git update-index --no-skip-worktreegits <file>
©"Stephan"Partzsch,"2015 10
Ignorierte)Dateien)finden
git ls-files -v | grep ^[sS]
©"Stephan"Partzsch,"2015 11
Manko
©"Stephan"Partzsch,"2015 12
Kollabora'on
• Einstellungen+sind+nur+lokal
• Jeder+muss+die+Commands+selbst+ausführen
• Lösung:"Script,"das"alle"Commands"ausführt
• Script"wird"nach"erstem"Checkout"gestartet"
©"Stephan"Partzsch,"2015 13
Beispiel
©"Stephan"Partzsch,"2015 14
Beispiel'–'Git$Repository$anlegen
// Create git repository
$ mkdir git-test
$ cd git-test
$ git init
Initialized empty Git repository in …
©"Stephan"Partzsch,"2015 15
Beispiel'–'Datei&zum&Repository&hinzufügen
$ echo ‘Hello World’ > file01.txt
$ git add file01.txt
$ git commit -m ‘Adds a new file.’
[master (root-commit) a6053cf] Adds a new file.
1 file changed, 1 insertion(+)
create mode 100644 file01.txt
©"Stephan"Partzsch,"2015 16
Beispiel'–'Datei&verändern
$ echo ‘here are some changes’ >> file01.txt
$ git status
On branch master
Changes not staged for commit:
(use “git add <file>...” to update what will be committed)
(use “git checkout -- <file>...” to discard changes in working directory)
modified: file01.txt
no changes added to commit (use “git add” and/or “git commit -a”)
©"Stephan"Partzsch,"2015 17
Beispiel'–'Datei&ignorieren
$ git update-index --skip-worktree file01.txt
$ git status
On branch master
nothing to commit, working directory clean
©"Stephan"Partzsch,"2015 18
Beispiel'–'Datei&wieder&berücksich0gen
$ git update-index --no-skip-worktree file01.txt
$ git status
On branch master
Changes not staged for commit:
(use “git add <file>...” to update what will be committed)
(use “git checkout -- <file>...” to discard changes in working directory)
modified: file01.txt
no changes added to commit (use “git add” and/or “git commit -a”)
©"Stephan"Partzsch,"2015 19
English!blog!post
h"p://blog.stephan0partzsch.de/how0to0ignore0changes0in0
tracked0files0with0git
@StephanPartzsch
©"Stephan"Partzsch,"2015 20

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Ignorieren versionierter Dateien in Git