Environment preparation#
Installing Git
- We use Gitlab version management software in Labranet environment on this course
- In order to use Git environment, student should have Git client installed
- Installation guide:
- Many Linux distributions have Git preinstalled, but for example in Windows and Mac OS operating systems Git client can be downloaded here
- Run the installer (default settings can be used)
- Verify that Git client has been installed successfully by opening command prompt (Windows) or terminal (Mac) and run the following command: git --version (see the example below)
Repository description for exercises#
- All exercises are held in one repository, which will be copied (fork) to own Gitlab environment and then clone that forked repository to local computer
- Exercises will be done in your local computer
- When exercises are done, all changes will be transferred to forked repository, where teacher can then assess the exercises
- Below is a presentation of this Git process
- Repository will include the following files:
- Exercise directory
- ex01-python-fundamentals.ipynb
- ex02-python-fundamentals.ipynb
- ex03-data-sources.ipynb
- ex04-pandas-part-1.ipynb
- ex05-pandas-part-2.ipynb
- ex06-numpy.ipynb
- ex07-data-visualization.ipynb
- ex08-K-means-clustering.ipynb
- ex09-KNN.ipynb
- ex10-Decision-tree.ipynb
- data_files directory
- earthquakes.csv
- gamedata.json
- netflix_titles.xml
- voice.csv
- Exercise directory
Creating a copy of the original repository#
-
Take a copy of the original repository by following these steps:
- Go to address https://gitlab.labranet.jamk.fi/hantt/ttc2050-exercises
- Click the Fork button
- Choose your own account in the Namespace section
-
Now you should have a copy of the original repository
- By default, all repositories are public so set your repository to be private by following these steps:
- Go to your repository and choose Settings → General → Visibility, project features, permissions → Project visibility and choose Private
- Apply the changes by clicking Save changes
Cloning the repository to your own computer#
- Copy the url of your repository, which will be used for cloning process (check the guide below)
- Clone your fork repository to your computer by following these steps:
- Open Git GUI program
- Choose Clone Existing Repository
- Set the url of your fork repository to Source Location section
- Set the directory of your choice to Target Directory section
- Finally choose Clone
- Verify that cloning has been completed successfully by moving to the target directory in your computer and ensure that all exercise files are found inside the directory
- Clone your fork repository to your computer by following these steps:
- Move to the directory where you want to clone the source directory called ttc2050-exercises
- Use the command git clone https://gitlab.labranet.jamk.fi/user/ttc2050-exercises.git where user is your LabraNet username (for example https://gitlab.labranet.jamk.fi/h1111/ttc2050-exercises.git)
- Verify that cloning has been completed successfully by listing the content of the cloned directory with the commandls -l ttc2050-exercises
Returning the exercises#
- When all exercises are ready, return them by following these steps:
- Open Git GUI program
- Choose Open Existing Repository and choose repository directory (you can also do this from the main view under the Open Recent Repository section if your repository is listed there)
- List changes by pressing Rescan button
- File listing for non-selected files should be found under the Unstaged Changes section
- Choose exercises so the changes will be moved under the Staged Changes (Will Commit) section
- Write the message for the return ("Exercise return") to Commit Message field and choose Commit
- Transfer the changes to your repository by selecting Push and choose Push from opening window (default settings can be used here)
- If asked, input your Labranet credentials and choose OK
- Open browser and move to your repository in address https://gitlab.labranet.jamk.fi and ensure that all the changes have been successfully transferred
- Your repository should now be in private security setting. Add permissions for the teacher by following these steps:
- Choose Project information → Members
- Add teachers account hantt to the Gitlab member or Email address field
- Use setting Reporter for the Choose a role permission field
- Sent the invitation by pressing Invite
- Finally, return your repository url to Moodle's return box for assessment. Important: Return your repository url at the moment when you are certain your repository can be graded (not earlier)!
-
- Move to directory where you initially cloned your repository
- All changes can be seen with command git status
- Not staged changes can be added with git add file_path/file_name (for example git add exercises/exercise-01.ipynb)
- When all exercises have been added for commit, run the command git commit -m 'Exercise return'
- Transfer changes to your repository with command git push
- Provide Labranet credentials if asked
- Open browser and move to your repository in address https://gitlab.labranet.jamk.fi and ensure that all the changes have been successfully transferred
- Your repository should now be in private security setting. Add permissions for the teacher by following these steps:
- Choose Project information → Members
- Add teachers account hantt to the Gitlab member or Email address field
- Use setting Reporter for the Choose a role permission field
- Sent the invitation by pressing Invite
- Finally, return your repository url to Moodle's return box for assessment. Important: Return your repository url at the moment when you are certain your repository can be graded (not earlier)!