Gimp 2.10 or Gimp 3 A couple of ways but just one-at-a-time 
1) Right click on a gradient, duplicate it and Gimp makes a copy in ggr format. You might have to do a bit of text editing for a better name. Showing the file(s) in the background.
2) Open the Palettes dock, right click and import a new palette from the image. Right click on the new palette and select palette to gradient. This gives a gradient with the number of colours that you previously set in the new palette.
Edit: for Gimp 2.10 - If you can get the gimp-gmic-qt plugin working that has a gradient from image filter.

1) Right click on a gradient, duplicate it and Gimp makes a copy in ggr format. You might have to do a bit of text editing for a better name. Showing the file(s) in the background.
2) Open the Palettes dock, right click and import a new palette from the image. Right click on the new palette and select palette to gradient. This gives a gradient with the number of colours that you previously set in the new palette.
Edit: for Gimp 2.10 - If you can get the gimp-gmic-qt plugin working that has a gradient from image filter.