O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

OSMC 2022 | Git Good – How knowing git can make your life easier by Feu Mourek

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio

Confira estes a seguir

1 de 39 Anúncio

OSMC 2022 | Git Good – How knowing git can make your life easier by Feu Mourek

Baixar para ler offline

In our tech life, it’s hard to avoid git. Pretty much everyone has to interact with it in a brief way, to make a commit at some point, or to review someones changes. Gits complexity can be get really intimidating and scary when you dig in deeper. But don’t let that scare you off, because once you understand what it is trying to do, it is a lot less daunting. And you will want to integrate it into every single one of your projects!

In our tech life, it’s hard to avoid git. Pretty much everyone has to interact with it in a brief way, to make a commit at some point, or to review someones changes. Gits complexity can be get really intimidating and scary when you dig in deeper. But don’t let that scare you off, because once you understand what it is trying to do, it is a lot less daunting. And you will want to integrate it into every single one of your projects!

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Mais recentes (20)

Anúncio

OSMC 2022 | Git Good – How knowing git can make your life easier by Feu Mourek

  1. 1. How knowing git can make your life easier by Feu Mourek Git Good
  2. 2. Feu Mourek (they / them) Developer at Netways 2016 to 2020 Developer Advocate at Icinga from 2020 Git / GitLab Trainer since 2019 Passionate about: Teaching, Accessibility, Inclusiveness, Old Cars My Twitter is @the_feufeu
  3. 3. Agenda 1. Learning about Git 2. Working with Git, instead of around 3. Which workflow fits you? 4. Sharing this knowledge
  4. 4. Learning Git - What is Git? - Where does it come from? - Start small, understand, move on - Practice on CLI - Do I really need to know all of these commands?
  5. 5. What is a commit? - Think of it as snapshots - Only saves differences to the last commit - Contains general meta information - Author - Time - Message with description and references - Pointer to previous commit - One of many point in the projects history
  6. 6. Good Commits - Configure your name and email - One commit contains one topic - If needed split your commits - Make your commit messages short and precise - Add references if you can - Use the staging area:
  7. 7. The Three Stages - Working directory: files on your filesystem - Staging area: file states saved by git - Repository: snapshots of points in history Only Repository will be synchronised with the server
  8. 8. Git Branches - Allow free switching between different states of the project - Different features can be developed simultaneously - Different branching models allow for a smooth development workflow
  9. 9. Centralised Workflow - Small projects (1-3 Developers) - Working on a single branch
  10. 10. Centralised Workflow - Small projects (1-3 Developers) - Working on a single branch Pros: - Very simple - Very fast Cons: - Many conflicts - Possibly broken code in main
  11. 11. Feature Branch Workflow - Medium projects (up to 30 Developers) - Main branch only contains completed features - Features completed in own branches - Feature branches work like Centralised Workflow
  12. 12. Feature Branch Workflow - Medium projects (up to 30 Developers) - Main branch only contains completed features - Features completed in own branches - Feature branches work like Centralised Workflow Pros: - Stable main - Less interference with others - Good for reviews Cons: - Communication about features - No release ready main
  13. 13. Gitflow Workflow - Large projects - Extended Feature Branch Workflow - More complexity and nuance
  14. 14. Gitflow Workflow - Large projects - Extended Feature Branch Workflow - More complexity and nuance Pros: - Very organised - Permission oriented - Easy automation Cons: - Very complex - Needs people to overlook the processes
  15. 15. Merge Conflicts - They happen to us all - And they look scarier than they are
  16. 16. Merge Conflicts $ git merge new_branch_to_merge_later Auto-merging merge.txt CONFLICT (content): Merge conflict in merge.txt Automatic merge failed; fix conflicts and then commit the result.
  17. 17. Merge Conflicts $ cat merge.txt <<<<<<< HEAD this is some content to mess with content to append ======= totally different content to merge later >>>>>>> new_branch_to_merge_later
  18. 18. Merge Conflicts $ git add merge.txt $ git commit -m "merged and resolved the conflict in merge.txt"
  19. 19. Merge Conflicts $ cat merge.txt <<<<<<< HEAD this is some content to mess with content to append ======= totally different content to merge later >>>>>>> new_branch_to_merge_later
  20. 20. How to teach Git - Git is complex, take it step by step - If there is a question, solve it together - The official documentation is super useful - Explain with real world examples - Your search engine is your friend!
  21. 21. Thanks for being here with me! Twitter @the_feufeu GitHub Repo github.com/NETWAYS/gitlab-training Trainings netways.de/en/trainings

×