Your SlideShare is downloading. ×
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Git - Some tips to do it better
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Git - Some tips to do it better

5,694

Published on

This short presentation was a 20 minute talk for Barcamp 4 in Ghent (2011). The talk is about how to work better with GIT. Some tips and tricks and must-do's for people who already use git

This short presentation was a 20 minute talk for Barcamp 4 in Ghent (2011). The talk is about how to work better with GIT. Some tips and tricks and must-do's for people who already use git

Published in: Technology
0 Comments
23 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,694
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
136
Comments
0
Likes
23
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. GITSome 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 backgroundI learned git because of @kohanaphp his switch to git
    • 4. ... and with the love from @githubIf you don’t have a @github account yet, then this talk isn’t for you...
    • 5. ... and with the love from @githubIf you don’t have a @github account yet, then this talk isn’t for you...
    • 6. 5 MUST-DO’s as git user or you would better not start using git at all...
    • 7. 1. Don’t 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 GUI’s but becoming an expert is easier the hard way, the CLI-way!
    • 8. 2. Configure git like it should be...•$ git config --global color.ui true•$ git config --global format.pretty oneline•$ git config --global core.autocrlf true (Windows) $ git config --global core.safecrlf true (Windows) $ git config --global core.autocrl input (OSX & linux)•$ git config --global core.excludesfile ~/.gitignore $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore• enable bash autocompletion (Google it for your OS)
    • 9. 2. Configure git like it should be...•$ git config --global color.ui true•$ git config --global format.pretty oneline•$ git config --global core.autocrlf true (Windows) use a LF $ git config --global core.safecrlf true (Windows) line lways end $ git config --global core.autocrl input (OSX & linux) ing s!•$ git config --global core.excludesfile ~/.gitignore $ printf ".DS_StorenThumbs.dbn._*n" >> ~/.gitignore• enable bash autocompletion (Google it for your OS)
    • 10. 2. Configure git like it should be...•$ git config --global color.ui true•$ git config --global format.pretty oneline•$ git config --global core.autocrlf true (Windows) use a LF $ git config --global core.safecrlf true (Windows) line lways end $ git config --global core.autocrl input (OSX & linux) ing s!•$ git config --global core.excludesfile ~/.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
    • 13. 5. Branch, branch and tag! Choose your own workflow Source: http://nvie.com/posts/a-successful-git-branching-model/
    • 14. 5 TIPS that will reducethe amount of WTF’sand hopefully making you commit better then before
    • 15. 1. Where’s my commit? Oh no! It’s 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
    • 16. 2. Use git merge --no-ffYou will not regret it if you want to revert it! Source: http://nvie.com/posts/a-successful-git-branching-model/
    • 17. 3. Use git add -iBecomes sometime you do different things together...
    • 18. 4. git submodule rm exists, right?
    • 19. 4. git submodule rm exists, right? No!$ vim .gitmodules$ vim .git/config$ git rm --cached path/to/module NO trailing slash!Commit your changes
    • 20. 5. I didn’t change my file but still... git tracks file execution permissions too 2 Possibilities:• Track no permissions $ git config core.fileMode false• Apply the permissions to the files 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
    • 21. How to become an expert?
    • 22. ... 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/
    • 23. ... and use it, every day!
    • 24. Q&A Follow me at @glamorous_be Fork me on github.com/glamorousSome links on delicious.com/glamorous_be/git

    ×