59481

How can I tell Gitlab to mirror my Github repositories over the API?

Question:

I have seen that the Gitlab WebUI allows to set-up mirroring for repositories from e.g. Github (under MyCoolRepository --> Settings --> Repository --> Mirroring repositories).

I have seen that this is possible over the API, too: <a href="https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project" rel="nofollow">https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project</a>

Does anyone know how this works and which parameters the API needs for id?

I wanted to automate this process in a script because I do not want to set-up the automatic mirroring for each repository in Gitlab by hand...

Answer1:

As the docs specify, you just need to use the project ID, which you can see on:

<blockquote>

MyCoolRepository --> Settings --> General

</blockquote>

Or use the <a href="https://docs.gitlab.com/ee/api/README.html#namespaced-path-encoding" rel="nofollow">URL-encoded-path</a>

As far as the docs say, there is no way to set up this miroring configuration.

Recommend

  • Copying or Replicating Amazon RDS MYSQL weekly
  • ipad airplay mirroring to multiple airplay receivers (specifically for videos/pictures)
  • what video formats supported by chromecast device (mp4,flv,m3u8,flv,avi)?
  • How to refresh a test instance of SQL server with production data without using full backups
  • GitLab CI Runner, how to use volumes or mounts in service containers
  • How to solve Access denied in gitlab?
  • If else statement not working properly in Jenkins pipeline script (groovy)
  • Gitlab CI runner not building or showing any output
  • Fixed positioned elements disappear on page unload
  • What's wrong when I try to install ADT on Eclipse?
  • EJB @Schedule issue
  • Can long-polling be achieved in Restlet by just making the thread sleep?
  • Does Apportable support to build library binary (.a/.so)?
  • How to make jdk.nashorn.api.scripting.JSObject visible in plugin [duplicate]
  • revitapi ironpython ToRoom returns “indexer # object”
  • Zurb Foundation _global.scss meta styles for js?
  • How to convert workspace coordinates to screen coordinates?
  • Do I need to reset a Perl hash index?
  • CakePHP 2.0.4 - findBy magic methods with conditions
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • Hardware Accelerated Image Scaling in windows using C++
  • iOS: Detect app start via notification press
  • How to attach a node.js readable stream to a Sendgrid email?
  • RectangularRangeIndicator format like triangular using dojo
  • VS2008 Enable C++ Exception with SEH
  • Cross-Platform Protobuf Serialization
  • Hazelcast - OperationTimeoutException
  • Why winpcap requires both .lib and .dll to run?
  • QuartzCore.framework for Mono Develop
  • RestKit - RKRequestDelegate does not exist
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • How to get icons for entities from eclipse?
  • Revoking OAuth Access Token Results in 404 Not Found
  • Proper way to use connect-multiparty with express.js?
  • Load html files in TinyMce
  • python regex in pyparsing
  • Android Google Maps API OnLocationChanged only called once
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • JaxB to read class hierarchy
  • How can I use threading to 'tick' a timer to be accessed by other threads?