stash repository path on linux

How can I know the repository path on linux?

I choiced "/var/atlassian/stash/data/repositories" as repository root path.
Then I created some projects and repositories.
Now I want to edit hook script, but I cannot know the target repository's path.
(Some numbering directory(1, 2, 3... not project and repository name) exist in repositries directory)


  • scientific linux 6.0
  • stash 1.1.1 with hsqldb

5 answers

1 accepted

1 vote
Accepted answer
Jason Hinch Atlassian Team Aug 07, 2012

To help mitigate this issue we've created a plugin for Stash, the Repository System Info Plugin. It allows system administrators to view the location on disk of the repository through the Stash UI.

EDIT: As of 2.7 you can view this information on the repository settings page.

Is there a way to access the location via calling the plugin in Hook code? trying to get the repository directory from the post recieve hook to modify a file in the Hook code.


Sameer Jaffer

2 votes
Seb Ruiz Atlassian Team Jul 16, 2012


There is currently no way in Stash to determine where a repository lives on disk without peeking into the database and looking at the repository id.

There is an open feature request to make repositories on disk easier to find.



thanks for response :)

Also Thank your for this information!

I would say the numbers relate to the repository id internally in stash.

You might have to use the stash REST API to find the repository id out though

Which api do I need to use in ?

I tried to use "{projectKey}/repos/{repositorySlug} ", but I couldn't get the repository id.
curl -u xxx:xxx -X GET -H "Content-Type: application/json" http://localhost:7990/stash/rest/api/1.0/projects/TEST/repos/repo

1 vote

Since Stash 2.1, the repository id is also returned from the REST API.

curl -u admin:admin -X GET http://localhost:7990/stash/rest/api/latest/projects/PROJECT_1/repos/rep_1

Will now return:

    "name":"Project 1",
    "description":"Default configuration project #1",

The above url did not work for me, but http://localhost:7990/stash/rest/api/latest/projects/PROJECT_1/repos/rep_1 gave output aproximately as above.

The following did not work for me. Any clue ?

curl -u username:password -X GET http://localhost:7990/stash/rest/api/latest/projects/U3SI/repos/repo/dom-2010

Looks like the URL I provided had an extra /repo/ in the path that shouldn't have been there. I've fixed my comment with the correct URL.


curl -u username:password -X GET http://localhost:7990/stash/rest/api/latest/projects/U3SI/repos/dom-2010

Compare the directories in refs/heads to what you see in Stash GUI. If needed, dig a little deeper and compare the commit hash to last commit in Stash GUI.

Example: given a path <stash_home>/data/repositories/<some #>/refs/heads,

run ls to obtain a dir listing

compare output to Stash GUI Repository by clicking Repositories at top, by default it shows Files. Then click the directory drop down button directly underneath to show all dirs.

If your projects use a similar directory layout --

run less against one of the files listed using ls earlier.

compare hash against Stash GUI by clicking Commits (next to Files.) Usually the short code listed is fine, but you can click on it to obtain the full hash.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,906 views 7 10
Read article

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