question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't clone /owner/repo.git style url by git-2.12.2

See original GitHub issue

Before submitting an issue to Gitbucket I have first:

Issue

Impacted version: current master I checked maybe 4.11 too?

Deployment mode: standalone app with listen 80 port.

Problem description:

C:\Users\kounoike\Documents\gitbucket\t>git --version
git version 2.12.2.windows.2

C:\Users\kounoike\Documents\gitbucket\t>git clone http://localhost/root/JenkinsTest.git
Cloning into 'JenkinsTest'...
fatal: unable to update url base from redirection:
  asked for: http://localhost/root/JenkinsTest.git/info/refs?service=git-upload-pack
   redirect: http://localhost/git/root/JenkinsTest.git/info/refs

maybe, redirect isn’t accepted by current version of git cli? It is serious problem for GitBucket-Jenkins integration.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kounoikecommented, Aug 12, 2017

I found root cause. By https://github.com/git/git/blob/6628eb41db5189c0cdfdced6d8697e7c813c5f0f/http.c#L1513-L1517 , git checks original URL and redirected URL by tail. In current GitBucket(4.15.0), redirect response drops query string.

C:\Users\kounoike\Documents\gitbucket>git  http://localhost:8080/root/test.git
Cloning into 'test'...
fatal: unable to update url base from redirection:
  asked for: http://localhost:8080/root/test.git/info/refs?service=git-upload-pack
   redirect: http://localhost:8080/git/root/test.git/info/refs

I add query string, it works correctly. I will send PR.

0reactions
tsalcommented, May 29, 2017

I hit this same issue today trying to build out a docker stack. I can’t get the app to build locally, or I’d submit a pull request - basically, I think a route regex for /org/user/reponame.git that passes it to the same endpoint as /git/. If I can get a local build working, I’ll submit a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting cloning errors - GitHub Docs
If you're having trouble cloning a repository, check these common errors.
Read more >
Can't clone a github repo on Linux via HTTPS - Stack Overflow
The answer was simple but not obvious: Instead of: git clone https://github.com/org/project.git. do: git clone https://username@github.com/org/project.git.
Read more >
Repository in git2 - Rust - Docs.rs
An owned git repository, representing all state associated with the underlying filesystem. This structure corresponds to a git_repository in libgit2.
Read more >
Changelog - NodeGit
Support signing commits in Repository.prototype.mergeBranches . The last parameter processMergeMessageCallback is now deprecated, but will continue to work.
Read more >
Git Notes for Professionals - Falksangdata
the property of their respective owners ... Section 3.12: Set the URL for a Specific Remote ... Section 9.1: Cloning a Git repository...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found