The study of rocks and their formation, including the processes that create and change them over time.