Heat the olive oil in medium heat-proof skillet over medium-low heat with the clove of crushed garlic. Let the garlic infuse the oil while you thinly slice the potatoes and onion; then remove the garlic. Add the potatoes and onions to the skillet and season with rosemary and salt and pepper, to taste. Raise the heat a little and cook for 6 to 7 minutes. Turn the potato/onion mixture over and cook for 5 minutes more. In a large bowl, whisk the eggs and milk together. Add the egg mixture to the skillet and move them around and under the potatoes to settle them. Transfer the skillet to the oven and bake until golden on top, about 10 to 12 minutes. Scatter the cheese on top, turn the oven off and let sit for another couple of minutes. Remove from the oven and serve.