With the advent of open-source, the Internet, and the consequent widespread adoption of distributed development tools, such as software configuration management and issue tracking systems, a vast amount of valuable information concerning software development and evolution has become available. Mining Software Repositories (MSR)-a very active and interest-growing research field-deals with retrieving and analyzing this data. Empirical analyses of software repositories allow researchers to validate assumptions previously based only on intuitions, as well as finding novel theories. In turn, these theories about the software development phenomenon have been translated into concrete approaches and tools that support software developers and managers in their daily tasks. In this tutorial, we provide an overview of the state of the art of MSR. In particular, we describe what software repositories are, what in turn Mining Software Repositories is, what techniques are available to researchers and practitioners, and finally, what the limitations of MSR are nowadays, and how to fix them.