Copy of Manual_GitLab_GettingStarted_V2.docx authored by MuijzerF's avatar MuijzerF
# <span dir="">Manual: GitLab Getting Started</span>
<span dir="">Authors: Boudewijn van den Berg, Frodo Muijzer</span>
<span dir="">For questions and information, send an e-mail to: </span><span dir="">f.muijzer@utwente.nl</span>
<span dir="">Version 2, 18-02-2022</span>
## <span dir="">Part I: Setup</span>
### <span dir="">Step 1: Project Fork</span>
<span dir="">Contact one of the BSS GitLab administrators to create a personal folder that includes a fork\*\* of each of the project repositories\* you will work on.</span>
<span dir="">To go to your personal folder, go to the URL </span><span dir="">https://gitlab.utwente.nl/bss_development</span><span dir=""> and log in using your **student (or employee) number** and **UT password**. The admin will create a personal folder with your name in the folder ‘students’ or ‘staff’.</span>
<span dir="">You will receive an invitation via e-mail to join this folder. **After logging in on GitLab, go to this e-mail and click on the button to join the folder.**</span>
![image](uploads/3ca7c1b23d04d52f468923f3bd153263/image.png)
### <span dir="">Step 2: Install GitHub GUI</span>
<span dir="">Download GitHub desktop from </span><span dir="">https://desktop.github.com/</span><span dir=""> and install. When asked to create a GitHub account, press ‘skip’ (no GitHub account is required to use GitHub desktop).</span>
<span dir="">GitLab will subsequently ask for a name and e-mail address. Here, use any e-mail address where you would like to receive notifications from GitHub desktop.</span>
### <span dir="">Step 3: Clone Project Fork</span>
<span dir="">To start working on a project from you own computer, go to the fork of this project that was created by the administrator in your personal BSS development folder **(you can find this folder in BSS_development/Students/<your name>/<project> or BSS_development/Students/<your name>/<project>)** and clone the project using the following steps:</span>
![image](uploads/a8bf56c30973bd9aca3e07aae8f4a50f/image.png)
<span dir="">Press the ‘Clone’ button. Copy the URL displayed below ‘Clone with HTTPS’.</span>
<span dir="">Subsequently open your GitHub Desktop GUI. Here, go to File (top left corner) > Clone repository…</span>
![image](uploads/b73b326920bbf5e92e899de7210d7a10/image.png)
<span dir="">Here, paste the repository URL you copied from the GitLab website, and choose the path on your computer where you would like to store your local clone of the project. After entering both settings, press ‘Clone’.</span>
<span dir="">After pressing ‘Clone’ you will be asked for your username and password. Use your student or employee number as user name, and use your regular UT password.</span>
**<span dir="">Press ‘Fetch Origin’ to make sure all project folders are in sync.</span>**
<span dir="">Congratulations! Now you have created your own local clone of the project repository!</span>
## <span dir="">Part II: Working with GitLab</span>
### <span dir="">Write Code and Commit</span>
<span dir="">From now on, Git will track all the changes you make in the code of this project, and allows you to merge these changes with the original version of the code, when your code is ready. All you have to do, is to regularly commit your changes to GitLab, e.g. once a day.</span>
<span dir="">1. As a testcase, let’s go to the project folder and create a .txt file with the text “Hello World”.</span>
<span dir="">2. Now go to your GitHub desktop. You will see the changes to your code, or the files you created listed here.</span>
![image](uploads/fe2b99f621903907c24e812ca9d2400a/image.png)
<span dir="">3. Write a good description of your changes and press ‘Commit’.</span>
<span dir="">4. Press the blue button ‘Push Origin’ that appears in the GUI, or go to ‘Repository’ (top bar) à ‘Push Origin’ to make sure your changes are uploaded to the server.</span>
<span dir=""></span>
<span dir=""> </span>
## <span dir="">Administrator Instructions</span>
### <span dir="">Create Student/Staff repository</span>
<span dir="">1. Go to: </span><span dir="">https://gitlab.utwente.nl/bss_development/students</span><span dir=""> or </span><span dir="">https://gitlab.utwente.nl/bss_development/staff</span>
<span dir="">2. Select ‘New Subgroup’:</span>
![image](uploads/94a897205969cbbc4f34935f5c791363/image.png)
<span dir="">3. As name of the subgroup enter <first initial>\_<last name>. Make sure that the user is listed as ‘Maintainer’, to allow the user to push changes to his personal fork. Invite student/staff member to join group via the e-mail option on the bottom:</span>
![image](uploads/077edc822bf156d675f28eb9c31330c3/image.png)
<span dir="">4. Fork repositories that the student/staff member will work on to the subgroup of the student. To do so, go to the target repository, and press ‘Fork’.</span>
![image](uploads/1dcd1137d172495e049b304249b7eea1/image.png)
<span dir="">5. For the project namespace, select the namespace of the student’s/staff member’s personal subgroup:</span>
![image](uploads/d443ec6f54f2765bf2453c9e185eafce/image.png)
<span dir="">6. To allow the user to report issues in the main project. Go to the subgroup where the main project is located and list the user as ‘Reporter’:</span>
![image](uploads/0ad8b873bfa68c4cbd72798e8f85c544/image.png)
<span dir=""></span>
## <span dir="">Glossary</span>
<span dir="">\*Repository/Repo = A Git repository is a virtual storage of your project. It allows you to save versions of your code, which you can access when needed.</span>
<span dir="">\*\*Fork = A fork is a copy of a repository (repo) that sits in your account rather than the account from which you forked the data from. Once you have forked a repo, you own your forked copy. This means that you can edit the contents of your forked repository without impacting the parent repo.</span>
<span dir="">\*\*\*Clone = Clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository.</span>
\ No newline at end of file