# Introduction

What is git? Before explaining what it is and how it works, let me explain what problem it is intended to solve.

Say your are editing a file. For example the draft of your paper (in Latex) or your stata code. You probably have many files with different versions because everytime you make a change, you think it is the right change to make, but you're not 100 percent sure so you want to keep a copy of your file without the change. So your folder is full of `finaldraft.ext`, `finaldraftv2.ext` etc... or maybe `finaldraftoctober2017.ext`, `finaldraftnovemebr2017`, etc... Keeping these files is a decent idea but there are at least two big drawbacks with this method:

1. the more you go the bigger is your folder with more and more files. it becomes quite messy
2. there is no way to know what you've changed in each of these files. Say you want to go back to the file where you ran regressions on the full population instead of the women only, as you do in the latest version of your paper. Which file should you pick? Do you remember the date or the version number?

`Git` is the tool most commonly used to solve these issues. It is also very useful for team collaboration in files and code, but we will let this on the side for now.

Git allows you to save a comment every time you save a file indicating what you have changed. It allows you to have different versions of the same file that you can load one after the other, merge later in time and so on...

Git requires some practice and has a non-negligible entry cost. But it is worth it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://antoinearnoud-2.gitbook.io/git-for-economists/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
