- COMP.CE.510
- General Information
- Git Primer
Git primer
If you are new to Git, please consider taking the course Git Open and check its Plussa page TIE-GIT. Modules 1 and 2 (totaling to 1 cr) should be enough for this course.
This page is a short overview of Git actions you will need on this course.
Version control with Git:
Git is a version control system that was created as a tool for Linux kernel development.
Today it is widely used in software industry and is also very popular in open-source projects.
- Working tree
- Is the name for file and folder structure that is being versioned.
- Current directory contents
- Index / Stage / Cache
- Staging area, where the new commit is prepared.
- Local repository
- A local version of the repository where versions/commits are stored. You can actually find this information in .git folder that is hidden in the worktree's root.
- Remote repositories
- a remote version of the repository. Remote repository is used to synchronise local repositories and store local version history to some remote location.
- Your remote repository is called origin
- The remote repository can be found from TUNI Course GitLab

Git tools
- The linux-desktop servers have Git installed
- You can run these commands in the terminal
- The FPGA lab TC217 computers have Git for Windows installed
- You can open the command line interface running Git Bash
- There is also a graphical TortoiseGit, that can be reached from the Windows Explorer context menu (right click)
Git commands required for this course:
0. Git settings
- To get started, give Git your name and email used for commits. Also set the text editor to more user-friendly nano if you're not used to vi:
$ git config --global user.name "Teemu Teekkari" $ git config --global user.email "teemu.teekkari@tuni.fi" $ git config --global core.editor nano
1. Cloning your remote repository
- You can find your own cloning link in Course GitLab
$ git clone https://course-gitlab.tuni.fi/compce510-fall-2025/<GROUP_NUMBER>.git
2. Sharing your changes to the Remote repository (GitLab)
- When you want to publish and save your changed files to the Remote repository (GitLab):
- Add all changed/new files to Index
- Commit your changes in Index to Local repository
- Push your new commits from Local repository to Remote repository
$ git add .
$ git commit -m "Message"
$ git push origin
3. Updating your Local repository and Working tree
- If someone, usually you on a different machine or your groupmate, has made changes to the Remote repository, you have to update the contents of your Local repository:
- To update the changes made by others from the Remote repository
- If you both have done changes in same files, it will lead to conflicts
- Resolve the conflicts by editing the files manually and commit your changes
- To prevent conflicts, pull the changes before editing files
- TortoiseGit has a nice editor for resolving the conflicts
$ git pull origin
4. Updating your Local repository and Working tree with updates done by the course staff
- From time to time, you have to get some new files from the course template repository:
- Add the group template repository as new remote repository called course_upstream
- Fetch the new Remote repository to Local repository
- Merge the changes to your Working tree
$ git remote add course_upstream https://course-gitlab.tuni.fi/compce510-fall-2025/group_template_project.git
$ git fetch course_upstream
$ git merge course_upstream/main
Additional Git commands
- Show changes in Working directory after previous commit
$ git status
$ git log
$ git remote -v
Additional Git terminology
- Branches are different history paths that diverge from the main line of development
- The default branch is called main
- HEAD is a pointer to the last commit made in the repository
- The current version of the project, as known by Git
- A commit represents one version of the project
- Each commit contains line-level changes to files compared to the previous commit
- Tags can be used to mark important points in project history
- For example release points (v1.0, v2.1 and so on)
Posting submission...