How to create a directory

To create a directory in your project, you need to use your shell. You can learn how to start using Git on the command line and the command line basic commands before reading this documentation.

The following are the basic steps to create a directory through your shell:

Go into the repository or project that you’ll be working on:

1
cd NAME-OF-PROJECT

Download the latest changes in the project, so that you work on an up-to-date copy:

1
git pull

Create a branch (remember you can’t add spaces, you need to use a hyphen or underscore):

1
git checkout -b NAME-OF-BRANCH

Go into the file where you’d like to add the directory:

1
cd NAME-OF-FILE

Create a directory:

1
mkdir NAME-OF-YOUR-NEW-DIRECTORY

Then go into the new directory:

1
cd NAME-OF-YOUR-NEW-DIRECTORY

Create a README.md or index.md in directory:

1
2
3
4
5
6
touch README.md
nano README.md
#### ADD YOUR INFORMATION
#### Press: control + X
#### Type: Y
#### Press: enter

Go back one directory or file:

1
cd ../

View the changes you’ve made (it’s important to be aware of what’s happening and what’s the status of your changes):

1
git status

Add the changes to later commit (you’ll be able to see your changes in red when you type “git status”):

1
git add CHANGES

Check the status and you should see the name of your directory in green:

1
git status

Add a commit with your changes:

1
git commit -m "DESCRIBE COMMIT IN A FEW WORDS"

Send your changes to gitlab.com:

1
git push origin NAME-OF-BRANCH