gitlab

How to do a shallow clone using GitPython

How to do a shallow clone using GitPython Question: I am trying to do a shallow/partial clone of a repository using GitPython. Here is the git CLI command: $ git clone -v –filter=tree:0 –filter=blob:none –sparse [email protected]:gitlab-org/gitlab-docs.git ./Projects/ Cloning into ‘./Projects’… remote: Enumerating objects: 4145, done. remote: Counting objects: 100% (71/71), done. remote: Compressing objects: 100% …

Total answers: 2

How can I extract contents from a file stored in gitlab repos

How can I extract contents from a file stored in gitlab repos Question: Using the gitlab-python package, I’d like to extract lines from all Dockerfiles. Using my code below, I am able to get project names and url to the repo I want but how can I ensure there is a Dockerfile and read the …

Total answers: 1

how to upload a file into the WIKI of GitLab using Python

how to upload a file into the WIKI of GitLab using Python Question: Using the Python module python-gitlab, project management can be done on a GitLab server without using the built-in GitLab WEB-GUI, directly. So, the git repository and wikis can programmatically be operated on. Now, I have found a way to download, edit and …

Total answers: 2

GitLab CE API: Check if used token has admin rights

GitLab CE API: Check if used token has admin rights Question: I am working on a Python module for the GitLab API. Is there any possibility to check if the user with the private token in use has admin rights on the GitLab server? One way would be to get something from the API, e.g. …

Total answers: 3

remote: ImportError: No module named gitlab

remote: ImportError: No module named gitlab Question: I wrote gitlab hook with python. And added to post-receive hooks in gitlab server. When i push to remote origin server from my laptop, i get following error. But it works when i run script manually in gitlab server. How can i solve problem? Counting objects: 3, done. …

Total answers: 2