[Other doc versions]
[Doc downloads]
Atlassian Stash is the Git repository management solution for enterprise teams. It allows everyone in your organisation to easily collaborate on your Git repositories.
This page will guide you through the basics of Stash. By the end you should know how to:
This guide assumes that you don't have prior experience with Git. But we do assume that:
Please read Git resources or check out our Git tutorials for tips on getting started with Git.
The first thing you can do in Stash is to add collaborators.
Go to the Stash administration area, by clicking the 'cog' menu in the header, and then click Users (under 'Accounts'):
Click Create user to go directly to the user creation form:
Once you've created a user, click Change permissions to set up their access permissions:
There are 4 levels of user authentication:
See Users and groups for more information about authentication.
See External user directories if you have existing user identities you wish to use with Stash.
The next thing you do in Stash is to create a project. You'll add repositories to this project later.
Simply go to 'Projects' and click Create project. (Initially, you won't see as many projects as shown in this screenshot.)
Complete the form and submit it to create your new project:
See Creating projects for more information.
If you are a project administrator, you can grant project permissions to other collaborators.
Click Settings then Permissions for the project:
The 'Project permissions' page allows you to add users and groups to a project you've already created.
There are 3 levels of project access:
See Using project permissions for more information.
If you are a project administrator, you can create repositories in the project.
Once a repository is created, the project permissions are applied to the repository. That means all repositories created in a project share the same access and permission settings. If you already have a Git project you'd like to use, see Importing code from an existing project.
Click Create repository to open the repository creation form:
Once submitted you will be taken directly to your repository homepage. As there is no content in your repository yet, you'll see some instructions to help you push code to your repository.
See Creating repositories for more information.
This section describes how to clone the repository you just created and then push a commit back to it. You can see the clone URL to use at the top right of the screen. SSH access may be available.
In a terminal, run the following command (replace <stashURL>
with the URL for your instance of Stash):
git clone <stashURL>/git/<projectname>/<reponame>.git
Use your Stash username and password.
The result in your terminal should be similar to what you can see in the screenshot below.
You should now have a new empty directory tracked by Git, in the user space of your local machine. Let's add some content and push it back to Stash.
In your <reponame> directory, create a text file named helloworld.txt and write "Hello World" in it.
Now run the following command in your terminal
cd <reponame> git add . git commit -m "My first commit" git push origin master
If everything went fine, when you refresh the Stash screen, you will see that the homepage of your repository has been replaced with a file browser showing you a link to helloworld.txt.
There you go, you're ready to get coding with your collaborators.
For more information about getting your code into Stash, see Importing code from an existing project. Note that huge Git repositories (larger that a few GBs) are likely to impact the performance of the Git client – see this discussion.
Check out our Git tutorials and training for more information, and have a look at this list of basic Git commands that you will probably use often.