Git intermediate
Image source: Wikimedia

Git intermediate

Are you unsure about the level of your Git skills? Or did you start using Git recently and would like some pointers on where to go next? I hope I will be able to help you in both cases.

It’s going to be subjective

I don’t know of any metrics that you can use to assess one’s level of any version control system, therefore this article will be heavily subjective. If you know everything I mention in this article then in my personal opinion you can claim you know Git on at least intermediate level. If you aim at higher level of understanding Git then I would suggest you eventually go through Git source code and hopefully contribute to the development.

This article assumes you have at least basic understanding of Git, if you are just starting with Git then please consider covering the basics first. It also assumes you are working with Git console (IDEs do not count!). Without further due let’s get to the fun parts!

Managing repositories and Git client

  • You know how to create and configure repository on a hosting service (github, gitlab, bitbucket etc.) of your choice
  • You know how to initiate a local repository and link it to the hosting service
  • You know what .gitignore is for, you know how to create one and how to exclude individual files, all files with a given extension and whole directories [1]
  • You know how to configure username and e-mail for your Git client [2]
  • You know how to setup ssh identification [3]
  • You know how to resolve merge conflicts [4]

Playing nicely with others

  • You know at least one Git workflow / branching model (it should be relevant to your organization/company etc.) My personal favourite is [5]
  • You know Git rebase and it’s interactive option [6]
  • You know the dangers of git push --force and know it’s a good idea to be super careful with it [7]. Bonus point if you know about git push --force-with-lease [8]

  • You know how to write a good commit message [9]

Using Git for debugging

  • You have an idea how to use git bisect [10]
  • You know how to use git blame and you know it’s not a tool for guilt tripping other developers [11]

Tools etc.

  • You know what Git hooks are [12]
  • You know how to efficiently use git diff between commits, branches, files staged for commit etc. [13]
  • You know what submodules are and how to efficiently use them [14]

Wrapping up

If you know all the concepts listed above then you know Git pretty well! The knowledge you have should be enough to easily get you going on most problems you will encounter when using Git. Of course you will find some challenging problems every now and then but with your Git super powers you will not make too much of a mess in your repositories.

It’s more than likely that I forgot to mention some important git skills and therefore I’m planning to update this

  1. https://git-scm.com/docs/gitignore
  2. https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
  3. https://docs.gitlab.com/ce/ssh/README.html
  4. https://confluence.atlassian.com/bitbucket/resolve-merge-conflicts-704414003.html
  5. http://nvie.com/posts/a-successful-git-branching-model/
  6. https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase
  7. https://developer.atlassian.com/blog/2015/04/force-with-lease/
  8. http://movingfast.io/articles/git-force-pushing/
  9. http://chris.beams.io/posts/git-commit/
  10. https://git-scm.com/docs/git-bisect
  11. http://alblue.bandlem.com/2011/07/git-tip-of-week-assigning-blame.html
  12. http://githooks.com/
  13. https://git-scm.com/docs/git-diff
  14. https://chrisjean.com/git-submodules-adding-using-removing-and-updating/

Mateusz Sadowski

Mateusz Sadowski
Mat is a Robotics consultant and the author of Build Mobile Robots with ROS 2 LiveProject series.

Remote Robotics Consulting - A Five-Year Retrospective

In this blog post, I will highlight some of the updates since my last blog and offer some advice that I hope will be useful for anyone looking to get into technical consulting. Continue reading

I Created a Project-based ROS2 Course

Published on July 05, 2022

IMUs and LiDARs - Not Uncommon Pitfalls

Published on February 24, 2022