0

I've been asked to write a program with a co worker to automate some projects migrations.

We have a function that's supposed to create a gitlab repository(a project from what I understood ). It would takes for parameters the project's codename and it's actual name.

I've looked on the gitlab documentation that it's possible to create a new project from command line :

git push --set-upstream https://gitlab.example.com/namespace/nonexistent-project.git master

I've been trying severals ways to write but it always ends up by a fatal error, project not found and such.

git push --set-upstream https://name.of.space/gitlab/username/testproject.git master


git push --set-upstream https://name.of.space/gitlab/username/someSubDirectory/codeName/projectest.git

Am i writting it wrong or ?

Thanks for the reading, and sorry in advance for my english.

  • `I've looked on the gitlab documentation that it's possible to create a new project from command line` Can you show where you've found it? – Vlad Hanzha Feb 18 '19 at 11:35
  • Hi, yes. Here +> https://docs.gitlab.com/ee/gitlab-basics/create-project.html#push-to-create-a-new-project Did I read it wrong ? – SomeDevelopperJunior Feb 18 '19 at 12:18
  • I'm not sure about command you use. You have a username there and the example doesn't contain it. Could you try without it? – Vlad Hanzha Feb 18 '19 at 12:24
  • Nevermind, I just pasted the example command. The error I'm getting is fatal: unable to update url base from redirection: – SomeDevelopperJunior Feb 18 '19 at 12:30
  • fatal: unable to update url base from redirection: asked for: https://../gitlab/testproject.git/info/refs?service=git-receive-pack redirect: https://../gitlab/users/sign_in – SomeDevelopperJunior Feb 18 '19 at 12:50
  • *redirect: https://../gitlab/users/sign_in* Obviously you must be signed in. For https use [credential helper](https://stackoverflow.com/a/5343146/7976758) and login by, say, pulling or pushing from/to an existing repository; git asks you login/password and credential help caches it. For ssh protocol [generate a keypair](https://stackoverflow.com/a/2643584/7976758) and upload the public key. – phd Feb 18 '19 at 13:05
  • Alright, I'm going to try that, thank you. – SomeDevelopperJunior Feb 18 '19 at 13:29
  • Well my lead told me to use something else .. :/ Thank for your answers anyway and sorry for wasting some times. – SomeDevelopperJunior Feb 18 '19 at 16:43

0 Answers0