Your own GitLab project: a copy of the course repo
We set up the repository where you'll run pipelines: clone the course project, switch origin to your own, and make the first push.
We're setting up the repository where we'll run pipelines: clone the course project, switch
origin to your own, and make the first push.
Why this matters
For five lessons in a row, we build the same small site: two files, index.html and
style.css. Nothing to install, GitLab runs everything on its side. By the end, the site will be
live on the internet at its own address, and a pipeline will deploy it, not you by hand.
This lesson is prep work. You need a GitLab account and a repository you can push to freely.
Concepts
Remote is a named address of another repository that your local one exchanges commits with.
See the list: git remote -v.
origin is the default remote's name. git clone creates it automatically and writes down
the address it cloned from. git push with no arguments sends commits exactly there.
Upstream branch is the remote branch a local branch is tracking. For main that's usually
origin/main. Because of this link, git status prints
Your branch is up to date with 'origin/main', and git push and git pull know where to go
without arguments.
Account
Signing up at gitlab.com is the usual flow: email, password, confirmation via a link in the email. You can sign in with Google or GitHub instead, if you don't want a separate password.
After signing up, GitLab asks you to verify your identity, in stages: everyone confirms their email, a phone number is requested if the risk looks elevated, and at the top tier, a bank card. This is protection against miners: free runners hand out someone else's compute, and people keep trying to hijack them for their own jobs. No money is charged when you verify a card, and GitLab doesn't store its details. If you'd rather skip the check, lesson 5 of this track has a note about running your own runner, which doesn't need it.
The course repo
The original site lives here:
https://gitlab.com/izidevops-learn/ci-start
The repository is public, so you can clone it without any access. The root holds the site itself:
index.html, style.css and README.md. Next to them are folders like lesson-06-… and
further, material for later lessons you don't need yet.
There's no pipeline in the root on purpose: you'll write it yourself in the next lesson.
You can see what the result looks like at the end of the track here: ci-start-148d25.gitlab.io. That page is published by exactly the pipeline you'll build over five lessons.
git clone https://gitlab.com/izidevops-learn/ci-start.git
cd ci-start
You can clone this repository, but you can't push to it: it's not yours. So next we change the address a push goes to.
Your own empty project
In GitLab, top right, click Create new (the plus) → New project/repository →
Create blank project. Any name works, for example my-ci-site.
One setting matters: uncheck Initialize repository with a README. If you leave it checked,
the project gets a commit that your local copy doesn't have, and the very first push fails
with rejected (fetch first). An empty project doesn't create that conflict.
Set Visibility Level to Public. That way, the site's page at the end of the track can be opened without logging in, and you can show it to anyone.
How it works: switching origin
Right now origin points to the course repo:
git remote -v
origin https://gitlab.com/izidevops-learn/ci-start.git (fetch)
origin https://gitlab.com/izidevops-learn/ci-start.git (push)
Let's change the address to your own project. GitLab shows the URL on the empty project's page,
under the Clone button. Replace <your-login> with your GitLab login:
git remote set-url origin https://gitlab.com/<your-login>/my-ci-site.git
git remote -v
Now the output shows your address. The commit history hasn't gone anywhere, only the destination changed.
The first push
git push -u origin main
At the end of the output, there will be a line:
branch 'main' set up to track 'origin/main'.
The -u flag records the upstream branch: the local main is now tracking origin/main, so a
plain git push is enough from here on. After git clone, this link already exists, so the flag
is more of a safety net here. But in a repository created with git init, the first
git push with no arguments won't work without -u.
Refresh the project's page in your browser: index.html, style.css and README.md are there.
The repository is ready for the pipeline.
Common mistakes
rejected (fetch first). The project already has a commit of its own, usually the README. The
easiest fix is to create a new empty project without a README (for example, my-ci-site-2),
switch origin to it, and push. You can delete the old project: on its main page, top right,
Actions → Delete. GitLab first marks the project for deletion and doesn't wipe it right
away, so it's better to pick a different name for the new one.
git pull --rebase origin main in response to rejected. Plenty of answers online suggest this,
and it's a trap here. After set-url, Git still remembers that the origin/main branch used to
point to the course repo's last commit. Rebase decides all the site's commits are already "on the
server", and doesn't move any of them. The command reports success, and the working folder ends
up with only the README from GitLab. The commits aren't erased; Git still remembers them. How to
find and recover them is covered in lab 2.
Permission denied (publickey). You cloned over SSH, and your key isn't added to GitLab. For the
course repo, the HTTPS address is enough: git remote set-url origin https://.... GitLab will
ask for a login and a token instead of a password.
HTTP Basic: Access denied. The provided password or token is incorrect. Your account password
doesn't work for an HTTPS push: you need a personal access token. Create one like this: avatar,
top right → Edit profile → in the left menu, Access → Personal access tokens →
Generate token → Legacy token, with write_repository permission. On push, paste the
token in place of the password; the login can be anything non-empty.
Push rejected with a message that you don't have permission on the project. origin is probably
still pointing at the course repo. Check git remote -v.
What to remember
A cloned repository isn't bound to the original forever: git remote set-url origin <address>
switches the push target to any other project.
The README checkbox at project creation costs half an hour of debugging: an extra commit on GitLab's side breaks the first push.
Next we write the first .gitlab-ci.yml.
What you'll need for the tasks
git remote -v,git remote set-url origin <address>;git push -u origin mainand theset up to trackline in the output;git status -sbandgit log --oneline, to compare the local branch with the remote;git reflogandgit reset --hard <commit>, to move the branch back to where it was.
In the labs, local repositories in the work/gitlab/ folder play the role of GitLab, so you don't need
an account.
Done reading?
Mark the lesson as read to move your track progress forward.
Lesson marked as done.
Go through it with an AI agent
The agent explains anything unclear in plain words, gives you 2 labs for this lesson and drills you on interview questions. $49 one-time, lifetime access.
Tell the agent: use MCP izi, give me lesson cicd-practice-01-your-own-repo
Progress saved in this browser
Clear your history or open this on your phone, and the marks will be gone. Leave your email and they'll move to your account. No password needed.
Done. moved to your account. You can see your progress on any device. My progress