# Stash Latest : Getting started with Git and Stash

This page last changed on Sep 27, 2012 by pwatson.

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: Create accounts for your collaborators, and organize these into groups with permissions. Create a project and set up permissions. Create repositories, and know the basic commands for interacting with them. ## Assumptions This guide assumes that you don't have prior experience with Git. But we do assume that: You have Git version 1.7.6 or higher installed on your local computer. You are using a supported browser. You have Stash installed and running. See Installing Stash on Linux and Mac or Installing Stash on Windows. | On this page: Assumptions Add users to Stash and grant permissions Create your first project and share it with collaborators Creating your project Opening up project access to others Create a repository and get your code into Stash Create a repository A simple clone and push Related pages: External user directories Importing code from an existing project Installing Stash on Windows Installing Stash on Linux and Mac

## Add users to Stash and grant permissions

The first thing you can do in Stash is to add collaborators.

Go to the Users listing in the Administration area.

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 permissions:

- System Administrator — can access all the configuration settings of the Stash instance.
- Administrator — same as System Admins, but they can't modify file paths or the Stash server settings.
- Project Creator — can create, modify and delete projects.
- Stash User — active users who can access Stash.

See External user directories if you have existing user identities you wish to use with Stash.

## Create your first project and share it with collaborators

### Creating your project

The next thing you do in Stash is to create a project. You'll add repositories to this project later.

Simply click Create Project in the Projects page.

Complete the form and submit it to create your new project.

### Opening up project access to others

If you are a project administrator, you can grant project permissions to other collaborators.

Click the Permissions tab for the project.

On that page you can add users and groups to a project you've already created.

There are 3 levels of project access:

- Project Administrator — can create, edit and delete repositories and projects, and configure permissions for projects.
- Contributor — can push to and pull from all the repositories in the project.
- Observer — can only browse code and comments in, and pull from, the repositories in the project.

## Create a repository and get your code into Stash

### Create a repository

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.

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.

### A simple clone and push

Here you will simply 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.

Check out our Basic Git commands for more information regarding the basic Git commands that you will probably use often.

## Attachments:

create-user.png (image/png)
STA_10_create Repo.png (image/png)
Stash10_cloneRepo.png (image/png)
STASH10_createUser_pair.png (image/png)
STASH10_createProject_triple.png (image/png)
STASH10_createRepo_pair.png (image/png)
STASH10_permissionsBtn.png (image/png)
STASH10_projPermissions_pair.png (image/png)
STASH_overview.png (image/png)
create-project.png (image/png)
Screen shot 2012-02-29 at 2.29.20 PM.png (image/png)
skitched-20120327-132743.jpg (image/jpeg)
skitched-20120327-134721.jpg (image/jpeg)
skitched-20120327-135118.jpg (image/jpeg)
skitched-20120327-135301.jpg (image/jpeg)
skitched-20120327-135455.jpg (image/jpeg)
image2012-3-27 13:57:40.png (image/png)
skitched-20120327-135905.jpg (image/jpeg)
image2012-3-27 14:11:20.png (image/png)
Sash_1_1_create_user.png (image/png)
STash_1_1_user_permissions.png (image/png)
Stash_1_1_adding_users.png (image/png)
Stash_1_1_create_project.png (image/png)
Stash_1_1_create_project2.png (image/png)
Stash_1_1_create_project.png (image/png)
Stash_1_1_project_permissions.png (image/png)
Stash_1_1_project_permissions_anno.png (image/png)
Stash_1_1_createproject.png (image/png)
Stash_1_1_create_project2.png (image/png)
Stash_1_1_create_project.png (image/png)
watch_movie.png (image/png)
watch_movie.png (image/png)
Stash_1_1_create_project.png (image/png)
Stash_1_1_create_project2.png (image/png)
Stash_1_1_createproject.png (image/png)
Stash_1_1_project_permissions_anno.png (image/png)
Stash_1_1_project_permissions.png (image/png)
Stash_1_1_adding_users.png (image/png)
STash_1_1_user_permissions.png (image/png)
Sash_1_1_create_user.png (image/png)
image2012-3-27 14:11:20.png (image/png)
skitched-20120327-135905.jpg (image/jpeg)
image2012-3-27 13:57:40.png (image/png)
skitched-20120327-135455.jpg (image/jpeg)
skitched-20120327-135301.jpg (image/jpeg)
skitched-20120327-135118.jpg (image/jpeg)
skitched-20120327-134721.jpg (image/jpeg)
skitched-20120327-132743.jpg (image/jpeg)
Screen shot 2012-02-29 at 2.29.20 PM.png (image/png)
create-project.png (image/png)
STASH_overview.png (image/png)
STASH10_projPermissions_pair.png (image/png)
STASH10_permissionsBtn.png (image/png)
STASH10_createRepo_pair.png (image/png)
STASH10_createProject_triple.png (image/png)
STASH10_createUser_pair.png (image/png)
Stash10_cloneRepo.png (image/png)
STA_10_create Repo.png (image/png)
create-user.png (image/png)
Stash12_adding_users.png (image/png)
Stash12_change_permissions.png (image/png)