summaryrefslogtreecommitdiff
path: root/doc/gitlab-basics/add-file.md
blob: 27591a4a15af9c8062899a97380bae810ba2f31a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# How to add a file

You can create a file in your [shell](command-line-commands.md) or in GitLab.

To create a file in GitLab, sign in to GitLab.

Select a project on the right side of your screen:

![Select a project](basicsimages/select_project.png)

It's a good idea to [create a branch](create-branch.md), but it's not necessary.

Go to the directory where you'd like to add the file and click on the "+" sign next to the name of the project and directory:

![Create a file](basicsimages/create_file.png)

Name your file (you can't add spaces, so you can use hyphens or underscores). Don't forget to include the markup language you'd like to use :

![File name](basicsimages/file_name.png)

Add all the information that you'd like to include in your file:

![Add information](basicsimages/white_space.png)

Add a commit message based on what you just added and then click on "commit changes":

![Commit changes](basicsimages/commit_changes.png)

# On a new project

When starting a new project, there are some common files which the new project might need too. Therefore a message will be displayed by GitLab to make this easy for you.

![First file for your project](basicsimages/first_file.png)

When clicking on either `LICENSE` or `.gitignore`, a dropdown will be displayed to provide you with a template which might be suitable for your project.

![MIT license selected](basicsimages/mit_license.png)

The license, changelog, contribution guide, or `.gitlab-ci.yml` file could also be added through a button on the project page. In the example below the license has already been created, which creates a link to the license itself.

![New file button](basicsimages/file_button.png)