Making .git suffix for repository URLs optional


The Go language has a tool to fetch content from git repositories, build the result, and install a binary along GOPATH/bin.

Here is an example that works, but installs the binary strappy as "strappy.git", which is a slight misnomer.

$ go get

Of course, I do not want to forbid repository URLs ending in .git, but I would like to make it optional so I could do this

$ go get

Is this possible in Stash?


3 answers

1 accepted

0 votes
Answer accepted

Hi Mark,

Currently if you want to clone a repo in Stash you don't need to specify the .git extension even though the UI gives you the ".git" as the full URL for cloning.

You can have a look at STASH-4744 for reference as some of our devs commented on that.

Let us know if this answers your question.

Best regards,

Thiago Bomfim

Atlassian Support - Stash

Thiago, one more question on this subject. The port number in our clone URLs is causing "go get ..." problems. Is it possible to configure Stash to use meta tags as documented here: To illustrate, I would use this import in my Go application code import "" and the meta tag in the HTTP HEAD would map this to The endgame for us here is that we have a lot of already-cloned repositories with a port number in them. And Go cannot handle, nor will it anytime soon if ever, the port in the host part of the import path spec. So to use Go effectively with Stash, I have to a) change all the cloned URLs on all developer desktops to a form without the port and change where Stash listens to http clone requests, or b) port forward at the internal load balancer port 80 to port 7990 to remove the user-facing port spec, or c) this meta tag trick. Thanks for listening.

Hi Mark, What I understood from your question is that you want to be able to perform Git operations both using the standard port 80 and the 7990 in which the Tomcat is running. Is my understanding correct? If that's the case, why don't you set up a reverse proxy in front of Stash? We have a documentation to help you with that: You could install Apache where Stash is running, for instance. In that scenario, you would have Apache listening on port 80 and Stash listening on its 7990 Connector. I hope that helps. Best regards, Thiago Bomfim Atlassian Support - Stash

Thiago, What Mark is alluding to as option c) above is a feature of go get that will perform the mapping based on a meta tag in the fetched repo's HTML HEAD. Is it possible to modify this in stash? For example, import "" will result in the following request(s): (preferred) (fallback) If that page contains the meta tag <meta name="go-import" content=" git">; the go tool will verify that contains the same meta tag and then git clone into GOPATH/src/ The question is whether meta tags can be returned as part of a repo get? It seems that UI pages in stash can be "decorated":

There are JIRA 2 issues that I have found:

One looks like it is addressed, but meta tag support appears to not be on Atlassian's radar.

Gitlab fixed this a while ago:

It would be nice if Atlassian could keep up with their competitors. Golang is growing very fast and I hope the last thing Atlassian wants is to be an impediment to their customers.

We are really struggling with wanting to keep our source in Stash.

0 votes

Further support for go get was added in Stash 3.8.0.

Kind regards,
Stefan Petrucev
Atlassian Stash

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in United States

From Atlassian: Confluence Security Advisory - 2019-03-20

Atlassian released a security advisory on 3/20/2019.  The full advisory is here: In a nutshe...

21 views 0 1
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you