diff --git a/doc/gitlab-basics/README.md b/doc/gitlab-basics/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ffe1c3584244fa5e62998406dac07d227121a267 --- /dev/null +++ b/doc/gitlab-basics/README.md @@ -0,0 +1,11 @@ +# GitLab basics + +Step-by-step guides on the basics of working with Git and GitLab. + +* [Start using Git on the commandline](start-using-git.md) + +* [Create and add your SSH Keys](create-your-ssh-keys.md) + +* [Command Line basic commands](command-line-commands.md) + +* [Basic Git commands](basic-git-commands.md) diff --git a/doc/gitlab-basics/basic-git-commands.md b/doc/gitlab-basics/basic-git-commands.md new file mode 100644 index 0000000000000000000000000000000000000000..ed210ba542035f0432746d190df1610fb7166072 --- /dev/null +++ b/doc/gitlab-basics/basic-git-commands.md @@ -0,0 +1,59 @@ +# Basic Git commands + +* Go to the master branch to pull the latest changes from there +``` +git checkout master +``` + +* Download the latest changes in the project, so that you work on an up-to-date copy (this is important to do every time you work on a project), while you setup tracking branches +``` +git pull REMOTE NAME-OF-BRANCH -u +``` +(REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch) + +* Create a branch (remember that spaces won't be recognized, you need to use a hyphen or underscore) +``` +git checkout -b NAME-OF-BRANCH +``` + +* Work on a branch that has already been created +``` +git checkout NAME-OF-BRANCH +``` + +* To see the changes you've made (it's important to be aware of what's happening and what's the status of your changes) +``` +git status +``` + +* Add changes to commit (you'll be able to see your changes in red when you type "git status") +``` +git add CHANGES IN RED +git commit -m "DESCRIBE THE INTENTION OF THE COMMIT" +``` + +* Send changes to gitlab.com +``` +git push origin NAME-OF-BRANCH +``` + +* Throw away all changes in the Git repository, but leave unstaged things +``` +git checkout . +``` + +* Delete all changes in the Git repository, including untracked files +``` +git clean -f +``` + +* Remove all the changes that you don't want to send to gitlab.com +``` +git add NAME-OF-FILE -all +``` + +* Merge created branch with master branch. You need to be in the created branch +``` +git checkout NAME-OF-BRANCH +git merge master +``` diff --git a/doc/gitlab_basics/basicsimages/add_new_merge_request.png b/doc/gitlab-basics/basicsimages/add_new_merge_request.png similarity index 100% rename from doc/gitlab_basics/basicsimages/add_new_merge_request.png rename to doc/gitlab-basics/basicsimages/add_new_merge_request.png diff --git a/doc/gitlab_basics/basicsimages/add_sshkey.png b/doc/gitlab-basics/basicsimages/add_sshkey.png similarity index 100% rename from doc/gitlab_basics/basicsimages/add_sshkey.png rename to doc/gitlab-basics/basicsimages/add_sshkey.png diff --git a/doc/gitlab_basics/basicsimages/branch_info.png b/doc/gitlab-basics/basicsimages/branch_info.png similarity index 100% rename from doc/gitlab_basics/basicsimages/branch_info.png rename to doc/gitlab-basics/basicsimages/branch_info.png diff --git a/doc/gitlab_basics/basicsimages/branch_name.png b/doc/gitlab-basics/basicsimages/branch_name.png similarity index 100% rename from doc/gitlab_basics/basicsimages/branch_name.png rename to doc/gitlab-basics/basicsimages/branch_name.png diff --git a/doc/gitlab_basics/basicsimages/branches.png b/doc/gitlab-basics/basicsimages/branches.png similarity index 100% rename from doc/gitlab_basics/basicsimages/branches.png rename to doc/gitlab-basics/basicsimages/branches.png diff --git a/doc/gitlab_basics/basicsimages/commit_changes.png b/doc/gitlab-basics/basicsimages/commit_changes.png similarity index 100% rename from doc/gitlab_basics/basicsimages/commit_changes.png rename to doc/gitlab-basics/basicsimages/commit_changes.png diff --git a/doc/gitlab_basics/basicsimages/commit_message.png b/doc/gitlab-basics/basicsimages/commit_message.png similarity index 100% rename from doc/gitlab_basics/basicsimages/commit_message.png rename to doc/gitlab-basics/basicsimages/commit_message.png diff --git a/doc/gitlab_basics/basicsimages/commits.png b/doc/gitlab-basics/basicsimages/commits.png similarity index 100% rename from doc/gitlab_basics/basicsimages/commits.png rename to doc/gitlab-basics/basicsimages/commits.png diff --git a/doc/gitlab_basics/basicsimages/compare_braches.png b/doc/gitlab-basics/basicsimages/compare_braches.png similarity index 100% rename from doc/gitlab_basics/basicsimages/compare_braches.png rename to doc/gitlab-basics/basicsimages/compare_braches.png diff --git a/doc/gitlab_basics/basicsimages/create_file.png b/doc/gitlab-basics/basicsimages/create_file.png similarity index 100% rename from doc/gitlab_basics/basicsimages/create_file.png rename to doc/gitlab-basics/basicsimages/create_file.png diff --git a/doc/gitlab_basics/basicsimages/create_group.png b/doc/gitlab-basics/basicsimages/create_group.png similarity index 100% rename from doc/gitlab_basics/basicsimages/create_group.png rename to doc/gitlab-basics/basicsimages/create_group.png diff --git a/doc/gitlab_basics/basicsimages/edit_file.png b/doc/gitlab-basics/basicsimages/edit_file.png similarity index 100% rename from doc/gitlab_basics/basicsimages/edit_file.png rename to doc/gitlab-basics/basicsimages/edit_file.png diff --git a/doc/gitlab_basics/basicsimages/file_located.png b/doc/gitlab-basics/basicsimages/file_located.png similarity index 100% rename from doc/gitlab_basics/basicsimages/file_located.png rename to doc/gitlab-basics/basicsimages/file_located.png diff --git a/doc/gitlab_basics/basicsimages/file_name.png b/doc/gitlab-basics/basicsimages/file_name.png similarity index 100% rename from doc/gitlab_basics/basicsimages/file_name.png rename to doc/gitlab-basics/basicsimages/file_name.png diff --git a/doc/gitlab_basics/basicsimages/find_file.png b/doc/gitlab-basics/basicsimages/find_file.png similarity index 100% rename from doc/gitlab_basics/basicsimages/find_file.png rename to doc/gitlab-basics/basicsimages/find_file.png diff --git a/doc/gitlab_basics/basicsimages/find_group.png b/doc/gitlab-basics/basicsimages/find_group.png similarity index 100% rename from doc/gitlab_basics/basicsimages/find_group.png rename to doc/gitlab-basics/basicsimages/find_group.png diff --git a/doc/gitlab_basics/basicsimages/fork.png b/doc/gitlab-basics/basicsimages/fork.png similarity index 100% rename from doc/gitlab_basics/basicsimages/fork.png rename to doc/gitlab-basics/basicsimages/fork.png diff --git a/doc/gitlab_basics/basicsimages/group_info.png b/doc/gitlab-basics/basicsimages/group_info.png similarity index 100% rename from doc/gitlab_basics/basicsimages/group_info.png rename to doc/gitlab-basics/basicsimages/group_info.png diff --git a/doc/gitlab_basics/basicsimages/groups.png b/doc/gitlab-basics/basicsimages/groups.png similarity index 100% rename from doc/gitlab_basics/basicsimages/groups.png rename to doc/gitlab-basics/basicsimages/groups.png diff --git a/doc/gitlab_basics/basicsimages/https.png b/doc/gitlab-basics/basicsimages/https.png similarity index 100% rename from doc/gitlab_basics/basicsimages/https.png rename to doc/gitlab-basics/basicsimages/https.png diff --git a/doc/gitlab_basics/basicsimages/image_file.png b/doc/gitlab-basics/basicsimages/image_file.png similarity index 100% rename from doc/gitlab_basics/basicsimages/image_file.png rename to doc/gitlab-basics/basicsimages/image_file.png diff --git a/doc/gitlab_basics/basicsimages/issue_title.png b/doc/gitlab-basics/basicsimages/issue_title.png similarity index 100% rename from doc/gitlab_basics/basicsimages/issue_title.png rename to doc/gitlab-basics/basicsimages/issue_title.png diff --git a/doc/gitlab_basics/basicsimages/issues.png b/doc/gitlab-basics/basicsimages/issues.png similarity index 100% rename from doc/gitlab_basics/basicsimages/issues.png rename to doc/gitlab-basics/basicsimages/issues.png diff --git a/doc/gitlab_basics/basicsimages/key.png b/doc/gitlab-basics/basicsimages/key.png similarity index 100% rename from doc/gitlab_basics/basicsimages/key.png rename to doc/gitlab-basics/basicsimages/key.png diff --git a/doc/gitlab_basics/basicsimages/merge_requests.png b/doc/gitlab-basics/basicsimages/merge_requests.png similarity index 100% rename from doc/gitlab_basics/basicsimages/merge_requests.png rename to doc/gitlab-basics/basicsimages/merge_requests.png diff --git a/doc/gitlab_basics/basicsimages/new_issue.png b/doc/gitlab-basics/basicsimages/new_issue.png similarity index 100% rename from doc/gitlab_basics/basicsimages/new_issue.png rename to doc/gitlab-basics/basicsimages/new_issue.png diff --git a/doc/gitlab_basics/basicsimages/new_merge_request.png b/doc/gitlab-basics/basicsimages/new_merge_request.png similarity index 100% rename from doc/gitlab_basics/basicsimages/new_merge_request.png rename to doc/gitlab-basics/basicsimages/new_merge_request.png diff --git a/doc/gitlab_basics/basicsimages/new_project.png b/doc/gitlab-basics/basicsimages/new_project.png similarity index 100% rename from doc/gitlab_basics/basicsimages/new_project.png rename to doc/gitlab-basics/basicsimages/new_project.png diff --git a/doc/gitlab_basics/basicsimages/newbranch.png b/doc/gitlab-basics/basicsimages/newbranch.png similarity index 100% rename from doc/gitlab_basics/basicsimages/newbranch.png rename to doc/gitlab-basics/basicsimages/newbranch.png diff --git a/doc/gitlab_basics/basicsimages/paste_sshkey.png b/doc/gitlab-basics/basicsimages/paste_sshkey.png similarity index 100% rename from doc/gitlab_basics/basicsimages/paste_sshkey.png rename to doc/gitlab-basics/basicsimages/paste_sshkey.png diff --git a/doc/gitlab_basics/basicsimages/profile_settings.png b/doc/gitlab-basics/basicsimages/profile_settings.png similarity index 100% rename from doc/gitlab_basics/basicsimages/profile_settings.png rename to doc/gitlab-basics/basicsimages/profile_settings.png diff --git a/doc/gitlab_basics/basicsimages/project_info.png b/doc/gitlab-basics/basicsimages/project_info.png similarity index 100% rename from doc/gitlab_basics/basicsimages/project_info.png rename to doc/gitlab-basics/basicsimages/project_info.png diff --git a/doc/gitlab_basics/basicsimages/public_file_link.png b/doc/gitlab-basics/basicsimages/public_file_link.png similarity index 100% rename from doc/gitlab_basics/basicsimages/public_file_link.png rename to doc/gitlab-basics/basicsimages/public_file_link.png diff --git a/doc/gitlab_basics/basicsimages/select_branch.png b/doc/gitlab-basics/basicsimages/select_branch.png similarity index 100% rename from doc/gitlab_basics/basicsimages/select_branch.png rename to doc/gitlab-basics/basicsimages/select_branch.png diff --git a/doc/gitlab_basics/basicsimages/select_project.png b/doc/gitlab-basics/basicsimages/select_project.png similarity index 100% rename from doc/gitlab_basics/basicsimages/select_project.png rename to doc/gitlab-basics/basicsimages/select_project.png diff --git a/doc/gitlab_basics/basicsimages/settings.png b/doc/gitlab-basics/basicsimages/settings.png similarity index 100% rename from doc/gitlab_basics/basicsimages/settings.png rename to doc/gitlab-basics/basicsimages/settings.png diff --git a/doc/gitlab_basics/basicsimages/shh_keys.png b/doc/gitlab-basics/basicsimages/shh_keys.png similarity index 100% rename from doc/gitlab_basics/basicsimages/shh_keys.png rename to doc/gitlab-basics/basicsimages/shh_keys.png diff --git a/doc/gitlab_basics/basicsimages/submit_new_issue.png b/doc/gitlab-basics/basicsimages/submit_new_issue.png similarity index 100% rename from doc/gitlab_basics/basicsimages/submit_new_issue.png rename to doc/gitlab-basics/basicsimages/submit_new_issue.png diff --git a/doc/gitlab_basics/basicsimages/title_description_mr.png b/doc/gitlab-basics/basicsimages/title_description_mr.png similarity index 100% rename from doc/gitlab_basics/basicsimages/title_description_mr.png rename to doc/gitlab-basics/basicsimages/title_description_mr.png diff --git a/doc/gitlab_basics/basicsimages/white_space.png b/doc/gitlab-basics/basicsimages/white_space.png similarity index 100% rename from doc/gitlab_basics/basicsimages/white_space.png rename to doc/gitlab-basics/basicsimages/white_space.png diff --git a/doc/gitlab-basics/command-line-commands.md b/doc/gitlab-basics/command-line-commands.md new file mode 100644 index 0000000000000000000000000000000000000000..a15e275f27a0e4556a1f5001b46a47c541e9c644 --- /dev/null +++ b/doc/gitlab-basics/command-line-commands.md @@ -0,0 +1,72 @@ +# Command Line basic commands + +## Start working on your project + +* In Git, when you copy a project you say you "clone" it. To work on a git project locally (from your own computer), you will need to clone it. To do this, start by signing in at GitLab.com.. To do it, go to your [gitlab.com](https://gitlab.com) account + +* When you are on your Dashboard, click on the project that you'd like to clone, which you'll find at the right side of your screen + + + +* 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). When you're in the project, click on the HTTPS or SSH button at the right side of your screen. Then copy the link (you'll have to paste it on your shell in the next step) + + + +## On the command line + +* To clone your project, go to your computer's shell and type the following command +``` +git clone PASTE HTTPS OR SSH HERE +``` + +* A clone of the project will be created in your computer + +* Go into a project, directory or file to work in it +``` +cd NAME-OF-PROJECT-OR-FILE +``` + +* Go back one directory or file +``` +cd ../ +``` + +* To see what’s in the directory that you are in +``` +ls +``` + +* Create a directory +``` +mkdir NAME-OF-YOUR-DIRECTORY +``` + +* Create a README.md or file in directory +``` +touch README.md +nano README.md +#### ADD YOUR INFORMATION +#### Press: control + X +#### Type: Y +#### Press: enter +``` + +* Remove a file +``` +rm NAME-OF-FILE +``` + +* Remove a directory and all of its contents +``` +rm -rf NAME-OF-DIRECTORY +``` + +* View history in the command line +``` +history +``` + +* Carry out commands for which the account you are using lacks authority. (You will be asked for an administrator’s password) +``` +sudo +``` diff --git a/doc/gitlab_basics/create_your_ssh_keys.md b/doc/gitlab-basics/create-your-ssh-keys.md similarity index 95% rename from doc/gitlab_basics/create_your_ssh_keys.md rename to doc/gitlab-basics/create-your-ssh-keys.md index 1e7f7c285135cb19ef51724b10f408a2d94f418a..2b6a1f2d8089e12e5993c99be45aad8e7f3914d2 100644 --- a/doc/gitlab_basics/create_your_ssh_keys.md +++ b/doc/gitlab-basics/create-your-ssh-keys.md @@ -28,7 +28,7 @@ You need to connect your computer to your GitLab account through SSH Keys. They ## To generate an SSH Key on your commandline -* Go to your [commandline](start_using_git.md) and follow the [instructions](https://gitlab.com/help/ssh/README) to generate it +* Go to your [commandline](start-using-git.md) and follow the [instructions](https://gitlab.com/help/ssh/README) to generate it * Copy the SSH Key that your commandline created and paste it on the "Key" box on the GitLab page. The title will be added automatically diff --git a/doc/gitlab_basics/start_using_git.md b/doc/gitlab-basics/start-using-git.md similarity index 99% rename from doc/gitlab_basics/start_using_git.md rename to doc/gitlab-basics/start-using-git.md index f01a2f77eecdfe6c84dae6f28f49022a9f16a7c5..99103469cccef9e6dc72ff6ead58fc52b9412aeb 100644 --- a/doc/gitlab_basics/start_using_git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -40,7 +40,7 @@ git config --global user.name ADD YOUR USERNAME * Then verify that you have the correct username -``` +``` git config --global user.name ``` @@ -52,7 +52,7 @@ git config --global user.email ADD YOUR EMAIL * To verify that you entered your email correctly, type -``` +``` git config --global user.email ``` @@ -62,6 +62,6 @@ git config --global user.email * To view the information that you entered, type -``` +``` git config --global --list ``` diff --git a/doc/gitlab_basics/README.md b/doc/gitlab_basics/README.md deleted file mode 100644 index de56c3ab4fcfd2b3492acfcbba0c02f511a6f162..0000000000000000000000000000000000000000 --- a/doc/gitlab_basics/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# GitLab basics - -Step-by-step guides on the basics of working with Git and GitLab. - -* [Start using Git on the commandline](start_using_git.md) - -* [Create and add your SSH Keys](create_your_ssh_keys.md)