xj9 災害の̴女王dreamspace 9 9 9 9 9 9 9 9 9

quickly export gitlab projects

depending on your project settings, these commands may need to be repeated with &visibility=public, &visibility=internal, and &visibility=private added to the /users request. gitlab does not return the full list of projects in one request. you will need to repeat the mirror and delete commands until the list is exhausted.

git config --global credential.helper cache
git clone --mirror $some_private_repo

curl \
	-h "authorozation: bearer $personal_access_token" \
	-h "accept: application/json" \
	"https://gitlab.com/api/v4/users/$username/projects?limit=100" \
	| jq .[].http_url_to_repo \
	| xargs -n1 -p4 git clone --mirror

curl \
	-h "authorozation: bearer $personal_access_token" \
	-h "accept: application/json" \
	"https://gitlab.com/api/v4/users/$username/projects?limit=100" \
	| jq .[].id \
	| xargs -n1 -p4 -i{} \
		curl \
			-h "authorization: bearer $personal_access_token" \
			-x delete \
			"https://gitlab.com/api/v4/projects/{}"