Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Practical git

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Practical git

Introduction talk about Git

Martijn De Letter

December 17, 2015

Transcript

65 slides
  1. WAT IS GIT? Git is a free and open source

    distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance.
  2. WAT IS GIT? Git is a free and open source

    distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. distributed?
  3. FORK WORKFLOW • 1 repo per developer • core maintainers

    in charge of ‘official’ repo • open source projects • using pull requests
  4. GIT

  5. KEEP YOUR HISTORY CLEAN • merge back with no fast

    forward • (master) $ git merge --no-ff feature/exampe • easier to rollback
  6. KEEP YOUR HISTORY CLEAN • $ git pull --rebase •

    replay local commits onto (possible) remote commits
  7. REWRITE HISTORY • $ git rebase -i HEAD~4 • rewrite,

    combine commits and change commit message • only use on local commits!
  8. COMMIT MESSAGES • Separate subject from body with a blank

    line • Limit the subject line to 50 characters • Capitalize the subject line • Do not end the subject line with a period • Use the imperative mood in the subject line • Wrap the body at 72 characters • Use the body to explain what and why vs. how
  9. COMMIT MESSAGES • Refactor subsystem X for readability • Update

    getting started documentation • Remove deprecated methods • Release version 1.0.0
  10. OEFENING 1 • ga naar https://github.com/mdeletter/practicalgit • fork deze repo

    naar je eigen github account • git clone [eigen github account]/practicalgit.git • cd practicalgit • Maak een feature branch, zet je naam in de README.md • Commit je wijzigingen en push je feature branch naar je eigen repo • Ga naar https://github.com/mdeletter/practicalgit en maak een Pull Request aan
  11. OEFENING 2 • git checkout master • maak een nieuwe

    branch aan: feature/a • Voeg de tekst ‘A’ op regel 2 van de README.md • Commit de wijzigingen • Maak een 2e branch aan: feature/b vanaf master • Voeg in deze branch ook op regel 2 de tekst ‘B’ toe en commit de wijzigingen • git checkout master, en merge eerst feature/a en vervolgens feature/b terug
  12. OEFENING 3 • maak een nieuwe branch aan: feature/c •

    voeg 1 regel toe in de README.md, commit deze wijziging. • Doe dit 5 keer, zodat je 5 commits heb in deze branch. • Pas de commit history aan, zodat je 2 commits overhoud (samenvoegen). • git rebase -i HEAD~5
  13. GIT PROBLEMEN OPLOSSEN • Op basis van jullie projecten •

    Waar lopen jullie tegen aan • Hoe zien de commits eruit • Welke git workflow wordt er gebruikt • Wat kan je verbeteren..

More Decks by Martijn De Letter

Other Decks in Programming