diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-06-12 13:49:58 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-06-12 13:49:58 +0100 |
commit | 83ad5de637b884d97b3350a468b9a66c71507dca (patch) | |
tree | 6344200848b6da6b24a1fdbdb3cc2c4745ee6366 /doc/gitlab-basics | |
parent | 7f5703484b957718d4f9f576cf8ac22acc45c8de (diff) | |
parent | d94b162129ed7d3131efe7822a4f0c6b4991fb8e (diff) | |
download | gitlab-ce-fl-eslint-vue-house-keeping.tar.gz |
Merge branch 'master' into fl-eslint-vue-house-keepingfl-eslint-vue-house-keeping
* master: (47 commits)
Bumping gitlab-gollum-lib and gitlab-gollum-rugged_adapter
i18n: document how to use links without splitting sentences
Resolve "[Rails5] `ActionView::MissingTemplate` in spec/features/projects/wiki/user_views_wiki_page_spec.rb"
Add CI job to check Gemfile.rails5.lock
Add navigation theme documentation
Move Gitaly branch/tag/ref RPC's to opt-out
Add CI_{PIPELINE,JOB}_URL
Resolve "Update docs as GKE cluster creation label has changed from "project ID" to "project""
fixed/enhanced command-line documentation
Use nip.io instead of xip.io
[Rails5] Update Gitlab.rails5.lock
Fix typo in doc/development/README.md
Update import screenshot without LFS warning
Hide overflow on hr
Resolve "Milestone and labels dropdowns are misplaced with collapsed sidebar"
Fix collapse sidebar button color
Remove .row and .col-sm-12
Relax expectation in spec/models/project_spec.rb
fix padding in commit info
GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong
...
Diffstat (limited to 'doc/gitlab-basics')
-rw-r--r-- | doc/gitlab-basics/command-line-commands.md | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/doc/gitlab-basics/command-line-commands.md b/doc/gitlab-basics/command-line-commands.md index c9766040234..4666511d747 100644 --- a/doc/gitlab-basics/command-line-commands.md +++ b/doc/gitlab-basics/command-line-commands.md @@ -7,17 +7,19 @@ In Git, when you copy a project you say you "clone" it. To work on a git project When you are on your Dashboard, click on the project that you'd like to clone. To work in the project, you can copy a link to the Git repository through a SSH or a HTTPS protocol. SSH is easier to use after it's been -[setup](create-your-ssh-keys.md). While you are at the **Project** tab, select -HTTPS or SSH from the dropdown menu and copy the link using the 'Copy to clipboard' +[set up](create-your-ssh-keys.md). While you are at the **Project** tab, select +HTTPS or SSH from the dropdown menu and copy the link using the _Copy URL to clipboard_ button (you'll have to paste it on your shell in the next step). ![Copy the HTTPS or SSH](img/project_clone_url.png) ## On the command line +This section has examples of some basic shell commands that you might find useful. For more information, search the web for _bash commands_. + ### Clone your project -Go to your computer's shell and type the following command: +Go to your computer's shell and type the following command with your SSH or HTTPS URL: ``` git clone PASTE HTTPS OR SSH HERE @@ -25,33 +27,45 @@ git clone PASTE HTTPS OR SSH HERE A clone of the project will be created in your computer. ->**Note:** If you clone your project via an URL that contains special characters, make sure that they are URL-encoded. +>**Note:** If you clone your project via a URL that contains special characters, make sure that characters are URL-encoded. -### Go into a project, directory or file to work in it +### Go into a project directory to work in it ``` -cd NAME-OF-PROJECT-OR-FILE +cd NAME-OF-PROJECT ``` -### Go back one directory or file +### Go back one directory ``` -cd ../ +cd .. ``` -### View what’s in the directory that you are in +### List what’s in the current directory ``` ls ``` -### Create a directory +### List what’s in the current directory that starts with `a` + +``` +ls a* +``` + +### List what’s in the current directory that ends with `.md` + +``` +ls *.md +``` + +### Create a new directory ``` mkdir NAME-OF-YOUR-DIRECTORY ``` -### Create a README.md or file in directory +### Create a README.md file in the current directory ``` touch README.md @@ -62,6 +76,12 @@ nano README.md #### Press: enter ``` +### Show the contents of the README.md file + +``` +cat README.md +``` + ### Remove a file ``` @@ -74,12 +94,18 @@ rm NAME-OF-FILE rm -r NAME-OF-DIRECTORY ``` -### View history in the command line +### View command history ``` history ``` +### Execute command 123 from history + +``` +!123 +``` + ### Carry out commands for which the account you are using lacks authority You will be asked for an administrator’s password. @@ -88,8 +114,14 @@ You will be asked for an administrator’s password. sudo ``` -### Tell where you are +### Show which directory I am in ``` pwd ``` + +### Clear the shell window + +``` +clear +``` |