-1

I'm in the process of moving our internal GitLab server to Azure ADO repos and I've been tasked with exporting a list of projects with their last commit date so we can see what is useful and what we need to export.

For some reason, Git decided not to have a simple button for this, I have attempted to do this myself with a curl command which echos into a text file but I dont think I've got everything. Does anyone else have any suggestions?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

0

GitLab has a Project API where you can access a list of projects.

https://gitlab.example.com/api/v4/projects

This shows you a list of 20 projects. To show more (up to 100) you can use:

https://git.gm-elektronik.ch/api/v4/projects?per_page=100

If you have more than 100 projects you have to append the page number:

https://git.gm-elektronik.ch/api/v4/projects?per_page=100&page=2

Each project entry has a property "last_activity_at". I don't think you can specifically get the latest commit, without going through the projects one by one. If this is necessary, I suggest looking at the Events API.

Jeanot Zubler
  • 979
  • 2
  • 18