The purpose
apply a gradient to text in GIMP, using a method different from what’s commonly found elsewhere, one you find easier to maintain.
Step
In the Layers panel, right-click and choose “New Layer Group.”

With the newly created layer group selected, write your text in white.
(I’ve set the background to black for better visibility.)

With the layer group selected, choose “Add New Layer” to create a new layer.

Fill the created layer with a gradient. (I’ll summarize how to fill with a gradient at the bottom of the page.) Here’s what I did:

Select the layer filled with the gradient and change its Mode to “Difference (Dark)“.

Result
You’ve successfully applied a gradient to your text, as shown below!

how to apply a gradient:
Press and hold the Fill tool (or Bucket Fill tool) in the toolbox, then select the Gradient tool from the fly-out menu.

Press Ctrl+G to open the Gradient window and select “Foreground to Background (RGB)“.
Select the layer you want to fill with the gradient. Then, click and drag from the starting point to the ending point where you want the gradient to appear.
The entire layer will be filled with a gradient transitioning from your foreground color to your background color.
comment