Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » git-upload-pack not permitted when cloning
git-upload-pack not permitted when cloning [message #1780671] Thu, 25 January 2018 15:52 Go to next message
Dave Furrer is currently offline Dave FurrerFriend
Messages: 1
Registered: January 2018
Junior Member
I'm writing a java application that will checkout my GitLab repo if it hasn't already, else it will "pull".

When doing the initial checkout I get the error "Caused by: org.eclipse.jgit.errors.TransportException: git-upload-pack not permitted on ''"

Here is the basic code I've written. I'm using JGit version "". Any ideas what is going wrong here?

        Config conf = ConfigFactory.load();
        String accessToken = conf.getString("accessToken");
        System.out.println("Access Token: " + accessToken);
        File repoDirectory = new File("cosmotronsBinaries");
        String uri = "https://gitlab-ci-token:" + accessToken + "";
        CredentialsProvider cp = new UsernamePasswordCredentialsProvider("PRIVATE-TOKEN", accessToken);

        Git git = null;
        try {
            git =;
        } catch (RepositoryNotFoundException e) {
            try {
                System.out.println("New install, cloning git repo");

                git = Git.cloneRepository()
            } catch (GitAPIException ex) {
        } catch (IOException e) {

        if (git != null) {
            System.out.println("Updating git repo");
Re: git-upload-pack not permitted when cloning [message #1780776 is a reply to message #1780671] Fri, 26 January 2018 23:37 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 181
Registered: August 2016
Senior Member
Gitlab access tokens must be passed either as a parameter or as a header. See the Gitlab documentation.
Previous Topic:Installation aborts due to jetty
Next Topic:Ssh prompting unexpectedly depending on .ssh/config
Goto Forum:

Current Time: Tue Feb 18 00:35:14 GMT 2020

Powered by FUDForum. Page generated in 0.05665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top