Preheat oven to 350 degrees F. Combine cheddar cheese, mayonnaise, onions, and garlic. Cut bread in half lengthwise. Spread butter over both halves. Then spread cheese mixture evenly over each half, clear to the edges.
Put 1/2 loaf on a cookie sheet and cut it into 2" wide pieces, keeping slices together. Put the second 1/2 loaf on the same cookie sheet and repeat.
Bake for approx. 20 minutes until bubbly and cheese is melted.