ݺߣ

ݺߣShare a Scribd company logo
GIT
Some tips so we GIT it better then before...
WHO AM I?
@glamorous_be

- PHP Developer (@kohanaphp)
- jQuery lover
- GIT freak

- Founder @eidtickets
- Owner Glamorous.be
- President @jongvldwaregem    Jonas De Smet (86)
A little background
I learned git because of @kohanaphp his switch to git
... and with the love from @github
If you dont have a @github account yet, then this talk isnt for you...
... and with the love from @github
If you dont have a @github account yet, then this talk isnt for you...
5 MUST-DOs as git user
   or you would better not start using git at all...
1. Dont use a GUI, ever! CLI ftw!

? You   will never feel the power of GIT

? Not   (almost) every command is possible through a GUI



 OK, there are cool GUIs but becoming an expert is easier the
 hard way, the CLI-way!
2. Con?gure git like it should be...
?$   git con?g --global color.ui true

?$   git con?g --global format.pretty oneline

?$ git con?g --global core.autocrlf true (Windows)
 $ git con?g --global core.safecrlf true (Windows)
 $ git con?g --global core.autocrl input (OSX & linux)

?$ git con?g --global core.excludes?le ~/.gitignore
 $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore

? enable   bash autocompletion (Google it for your OS)
2. Con?gure git like it should be...
?$   git con?g --global color.ui true

?$   git con?g --global format.pretty oneline

?$ git con?g --global core.autocrlf true (Windows) use a
                                               LF
 $ git con?g --global core.safecrlf true (Windows) line lways
                                                       end
 $ git con?g --global core.autocrl input (OSX & linux)     ing
                                                               s!
?$ git con?g --global core.excludes?le ~/.gitignore
 $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore

? enable   bash autocompletion (Google it for your OS)
2. Con?gure git like it should be...
?$   git con?g --global color.ui true

?$   git con?g --global format.pretty oneline

?$ git con?g --global core.autocrlf true (Windows) use a
                                               LF
 $ git con?g --global core.safecrlf true (Windows) line lways
                                                       end
 $ git con?g --global core.autocrl input (OSX & linux)     ing
                                                               s!
?$ git con?g --global core.excludes?le ~/.gitignore  DR
                                                        Y
 $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore

? enable   bash autocompletion (Google it for your OS)
3. Use a remote repo if possible




                 and probably many more...
4. Use submodules when possible

? Better   overview of different parts in your code

? DRY: Re-use    repositories in every project trough submodules



 Good example: Every module in the @kohanaphp framework is a
 seperate repository, so different contributors and releases possible
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
5. Branch, branch and tag!
     Choose your own work?ow




          Source: http://nvie.com/posts/a-successful-git-branching-model/
5 TIPS that will reduce
the amount of WTFs
and hopefully making you commit better then before
1. Wheres my commit?
             Oh no! Its on a detached HEAD?!

?A   problem with submodules currently not on a branch

? Search for your commits SHA-reference (eg. a8e358c)
 $ git log -p

? Merge  it with your branch
 $ git checkout master
 $ git merge a8e358c
2. Use git merge --no-ff
You will not regret it if you want to revert it!




                Source: http://nvie.com/posts/a-successful-git-branching-model/
3. Use git add -i
Becomes sometime you do different things together...
4. git submodule rm exists, right?
4. git submodule rm exists, right?


                  No!
$ vim .gitmodules
$ vim .git/con?g
$ git rm --cached path/to/module   NO trailing slash!

Commit your changes
5. I didnt change my ?le but still...
           git tracks ?le execution permissions too
 2 Possibilities:

? Track no permissions
 $ git con?g core.?leMode false

? Apply the permissions to the ?les without have it in your repo
 $ git diff -p 
       | grep -E '^(diff|old mode|new mode)' 
       | sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' 
       | git apply
How to become an
     expert?
... read some resources

? Pro   Git book: http://progit.org/book/

? Github    help: http://gitref.org & http://help.github.com

? Git   manual: http://www.kernel.org/pub/software/scm/git/docs

? Git   screencasts: http://gitcasts.com/

? Git   ready: http://gitready.com/
... and use it, every day!
Q&A    Follow me at @glamorous_be
    Fork me on github.com/glamorous
Some links on delicious.com/glamorous_be/git

More Related Content

What's hot (20)

maksym vlasov - culture of git as roots of your ci
maksym vlasov - culture of git as roots of your cimaksym vlasov - culture of git as roots of your ci
maksym vlasov - culture of git as roots of your ci
Dariia Seimova
?
SCM Gitlab Advanced
SCM Gitlab AdvancedSCM Gitlab Advanced
SCM Gitlab Advanced
Aman Patial
?
Ktor 101 ( Ktor Website )
Ktor 101 ( Ktor  Website )Ktor 101 ( Ktor  Website )
Ktor 101 ( Ktor Website )
Shengyou Fan
?
ZSH and RVM
ZSH and RVMZSH and RVM
ZSH and RVM
freelancing_god
?
GIT - DUG Antwerp
GIT - DUG AntwerpGIT - DUG Antwerp
GIT - DUG Antwerp
Krimson
?
Git hooks
Git hooksGit hooks
Git hooks
BinBin He
?
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
?
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
Alec Clews
?
ߤܲ˱ʸ
ߤܲ˱ʸߤܲ˱ʸ
ߤܲ˱ʸ
tzm_freedom
?
ʱƥȤ줳
ʱƥȤ줳ʱƥȤ줳
ʱƥȤ줳
tzm_freedom
?
Git hooks
Git hooksGit hooks
Git hooks
Skills Matter
?
Git session day 2
Git session day 2Git session day 2
Git session day 2
Mosaab Ehab
?
Git! Why? How?
Git! Why? How?Git! Why? How?
Git! Why? How?
Daniel Kummer
?
Golang preso
Golang presoGolang preso
Golang preso
Christopher Foresman
?
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
edgester
?
CRuby_Committers_Whos_Who_in_2014
CRuby_Committers_Whos_Who_in_2014CRuby_Committers_Whos_Who_in_2014
CRuby_Committers_Whos_Who_in_2014
nagachika t
?
ChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robotsChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robots
Olivier Jacques
?
Git session day 1
Git session day 1Git session day 1
Git session day 1
Mosaab Ehab
?
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
Robert Dumas
?
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
Arpit Mohan
?
maksym vlasov - culture of git as roots of your ci
maksym vlasov - culture of git as roots of your cimaksym vlasov - culture of git as roots of your ci
maksym vlasov - culture of git as roots of your ci
Dariia Seimova
?
SCM Gitlab Advanced
SCM Gitlab AdvancedSCM Gitlab Advanced
SCM Gitlab Advanced
Aman Patial
?
Ktor 101 ( Ktor Website )
Ktor 101 ( Ktor  Website )Ktor 101 ( Ktor  Website )
Ktor 101 ( Ktor Website )
Shengyou Fan
?
GIT - DUG Antwerp
GIT - DUG AntwerpGIT - DUG Antwerp
GIT - DUG Antwerp
Krimson
?
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
?
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
Alec Clews
?
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
edgester
?
CRuby_Committers_Whos_Who_in_2014
CRuby_Committers_Whos_Who_in_2014CRuby_Committers_Whos_Who_in_2014
CRuby_Committers_Whos_Who_in_2014
nagachika t
?
ChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robotsChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robots
Olivier Jacques
?
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
Arpit Mohan
?

Similar to Git - Some tips to do it better (20)

Git presentation
Git presentationGit presentation
Git presentation
James Cuzella
?
Gitting the Most From Git
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
Chris Miller
?
Git-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptxGit-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptx
vietnguyen1989
?
Git-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptxGit-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptx
vietnguyen1989
?
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
?
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
?
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
?
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
?
Github - Git Training ݺߣs: Foundations
Github - Git Training ݺߣs: FoundationsGithub - Git Training ݺߣs: Foundations
Github - Git Training ݺߣs: Foundations
Lee Hanxue
?
Advanted git
Advanted git Advanted git
Advanted git
Sahil Gupta
?
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
?
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
?
git and github
git and githubgit and github
git and github
Darren Oakley
?
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
?
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
?
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
?
Basic git
Basic gitBasic git
Basic git
Casper Chen
?
Switching to Git
Switching to GitSwitching to Git
Switching to Git
Stephen Yeargin
?
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
?
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
?
Gitting the Most From Git
Gitting the Most From GitGitting the Most From Git
Gitting the Most From Git
Chris Miller
?
Git-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptxGit-guidance for beginner- IT support.pptx.pptx
Git-guidance for beginner- IT support.pptx.pptx
vietnguyen1989
?
Git-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptxGit-guidance for beginner- IT support.pptx
Git-guidance for beginner- IT support.pptx
vietnguyen1989
?
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
?
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
Derek Jacoby
?
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
Derek Jacoby
?
Github - Git Training ݺߣs: Foundations
Github - Git Training ݺߣs: FoundationsGithub - Git Training ݺߣs: Foundations
Github - Git Training ݺߣs: Foundations
Lee Hanxue
?
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
?
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
?
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
?
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
?
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
?

Recently uploaded (20)

Understanding Traditional AI with Custom Vision & MuleSoft.pptx
Understanding Traditional AI with Custom Vision & MuleSoft.pptxUnderstanding Traditional AI with Custom Vision & MuleSoft.pptx
Understanding Traditional AI with Custom Vision & MuleSoft.pptx
shyamraj55
?
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Precisely
?
A Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin EngineeringA Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin Engineering
Daniel Lehner
?
The Future of Repair: Transparent and Incremental by Botond De?nes
The Future of Repair: Transparent and Incremental by Botond De?nesThe Future of Repair: Transparent and Incremental by Botond De?nes
The Future of Repair: Transparent and Incremental by Botond De?nes
ScyllaDB
?
EaseUS Partition Master Crack 2025 + Serial Key
EaseUS Partition Master Crack 2025 + Serial KeyEaseUS Partition Master Crack 2025 + Serial Key
EaseUS Partition Master Crack 2025 + Serial Key
kherorpacca127
?
Q4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor PresentationQ4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor Presentation
Dropbox
?
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
?
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
ScyllaDB
?
Brave Browser Crack 1.45.133 Activated 2025
Brave Browser Crack 1.45.133 Activated 2025Brave Browser Crack 1.45.133 Activated 2025
Brave Browser Crack 1.45.133 Activated 2025
kherorpacca00126
?
UiPath Agentic Automation Capabilities and Opportunities
UiPath Agentic Automation Capabilities and OpportunitiesUiPath Agentic Automation Capabilities and Opportunities
UiPath Agentic Automation Capabilities and Opportunities
DianaGray10
?
What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
?
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
?
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
?
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarterQ4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
MariaBarbaraPaglinaw
?
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
?
DevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdfDevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdf
Justin Reock
?
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
Safe Software
?
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
?
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramentoAIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
Alessandro Bogliolo
?
Technology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptxTechnology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptx
kaylagaze
?
Understanding Traditional AI with Custom Vision & MuleSoft.pptx
Understanding Traditional AI with Custom Vision & MuleSoft.pptxUnderstanding Traditional AI with Custom Vision & MuleSoft.pptx
Understanding Traditional AI with Custom Vision & MuleSoft.pptx
shyamraj55
?
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Precisely
?
A Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin EngineeringA Framework for Model-Driven Digital Twin Engineering
A Framework for Model-Driven Digital Twin Engineering
Daniel Lehner
?
The Future of Repair: Transparent and Incremental by Botond De?nes
The Future of Repair: Transparent and Incremental by Botond De?nesThe Future of Repair: Transparent and Incremental by Botond De?nes
The Future of Repair: Transparent and Incremental by Botond De?nes
ScyllaDB
?
EaseUS Partition Master Crack 2025 + Serial Key
EaseUS Partition Master Crack 2025 + Serial KeyEaseUS Partition Master Crack 2025 + Serial Key
EaseUS Partition Master Crack 2025 + Serial Key
kherorpacca127
?
Q4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor PresentationQ4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor Presentation
Dropbox
?
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
?
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
ScyllaDB
?
Brave Browser Crack 1.45.133 Activated 2025
Brave Browser Crack 1.45.133 Activated 2025Brave Browser Crack 1.45.133 Activated 2025
Brave Browser Crack 1.45.133 Activated 2025
kherorpacca00126
?
UiPath Agentic Automation Capabilities and Opportunities
UiPath Agentic Automation Capabilities and OpportunitiesUiPath Agentic Automation Capabilities and Opportunities
UiPath Agentic Automation Capabilities and Opportunities
DianaGray10
?
What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
?
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
?
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
?
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarterQ4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
Q4_TLE-7-Lesson-6-Week-6.pptx 4th quarter
MariaBarbaraPaglinaw
?
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
?
DevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdfDevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdf
Justin Reock
?
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
Safe Software
?
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
?
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramentoAIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
AIXMOOC 2.3 - Modelli di reti neurali con esperimenti di addestramento
Alessandro Bogliolo
?
Technology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptxTechnology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptx
kaylagaze
?

Git - Some tips to do it better

  • 1. GIT Some tips so we GIT it better then before...
  • 2. WHO AM I? @glamorous_be - PHP Developer (@kohanaphp) - jQuery lover - GIT freak - Founder @eidtickets - Owner Glamorous.be - President @jongvldwaregem Jonas De Smet (86)
  • 3. A little background I learned git because of @kohanaphp his switch to git
  • 4. ... and with the love from @github If you dont have a @github account yet, then this talk isnt for you...
  • 5. ... and with the love from @github If you dont have a @github account yet, then this talk isnt for you...
  • 6. 5 MUST-DOs as git user or you would better not start using git at all...
  • 7. 1. Dont use a GUI, ever! CLI ftw! ? You will never feel the power of GIT ? Not (almost) every command is possible through a GUI OK, there are cool GUIs but becoming an expert is easier the hard way, the CLI-way!
  • 8. 2. Con?gure git like it should be... ?$ git con?g --global color.ui true ?$ git con?g --global format.pretty oneline ?$ git con?g --global core.autocrlf true (Windows) $ git con?g --global core.safecrlf true (Windows) $ git con?g --global core.autocrl input (OSX & linux) ?$ git con?g --global core.excludes?le ~/.gitignore $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore ? enable bash autocompletion (Google it for your OS)
  • 9. 2. Con?gure git like it should be... ?$ git con?g --global color.ui true ?$ git con?g --global format.pretty oneline ?$ git con?g --global core.autocrlf true (Windows) use a LF $ git con?g --global core.safecrlf true (Windows) line lways end $ git con?g --global core.autocrl input (OSX & linux) ing s! ?$ git con?g --global core.excludes?le ~/.gitignore $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore ? enable bash autocompletion (Google it for your OS)
  • 10. 2. Con?gure git like it should be... ?$ git con?g --global color.ui true ?$ git con?g --global format.pretty oneline ?$ git con?g --global core.autocrlf true (Windows) use a LF $ git con?g --global core.safecrlf true (Windows) line lways end $ git con?g --global core.autocrl input (OSX & linux) ing s! ?$ git con?g --global core.excludes?le ~/.gitignore DR Y $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore ? enable bash autocompletion (Google it for your OS)
  • 11. 3. Use a remote repo if possible and probably many more...
  • 12. 4. Use submodules when possible ? Better overview of different parts in your code ? DRY: Re-use repositories in every project trough submodules Good example: Every module in the @kohanaphp framework is a seperate repository, so different contributors and releases possible
  • 16. 5. Branch, branch and tag! Choose your own work?ow Source: http://nvie.com/posts/a-successful-git-branching-model/
  • 17. 5 TIPS that will reduce the amount of WTFs and hopefully making you commit better then before
  • 18. 1. Wheres my commit? Oh no! Its on a detached HEAD?! ?A problem with submodules currently not on a branch ? Search for your commits SHA-reference (eg. a8e358c) $ git log -p ? Merge it with your branch $ git checkout master $ git merge a8e358c
  • 19. 2. Use git merge --no-ff You will not regret it if you want to revert it! Source: http://nvie.com/posts/a-successful-git-branching-model/
  • 20. 3. Use git add -i Becomes sometime you do different things together...
  • 21. 4. git submodule rm exists, right?
  • 22. 4. git submodule rm exists, right? No! $ vim .gitmodules $ vim .git/con?g $ git rm --cached path/to/module NO trailing slash! Commit your changes
  • 23. 5. I didnt change my ?le but still... git tracks ?le execution permissions too 2 Possibilities: ? Track no permissions $ git con?g core.?leMode false ? Apply the permissions to the ?les without have it in your repo $ git diff -p | grep -E '^(diff|old mode|new mode)' | sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' | git apply
  • 24. How to become an expert?
  • 25. ... read some resources ? Pro Git book: http://progit.org/book/ ? Github help: http://gitref.org & http://help.github.com ? Git manual: http://www.kernel.org/pub/software/scm/git/docs ? Git screencasts: http://gitcasts.com/ ? Git ready: http://gitready.com/
  • 26. ... and use it, every day!
  • 27. Q&A Follow me at @glamorous_be Fork me on github.com/glamorous Some links on delicious.com/glamorous_be/git

Editor's Notes