Налаштування репозиторію GitLab у Windows 11
09:10, 29.05.2026
Whether you’re a developer working on personal projects or collaborating with a team, version control is essential. GitLab, a web-based DevOps platform, offers a robust Git repository manager with CI/CD pipelines, issue tracking, and more.
This guide walks you through setting up a GitLab repository on a Windows 11 machine from scratch.
Prerequisites
Before getting started, ensure the following are installed.
- Git for Windows. Download Git and follow the installation instructions. During installation, select the default options unless you have specific preferences.
- GitLab Account. Sign up at gitlab.com if you haven’t already.
- Optional: Git Bash or Windows Terminal. While Git Bash is bundled with Git for Windows, you can also use Windows Terminal or PowerShell.
Step 1: Configure Git
Once Git is installed, open Git Bash or PowerShell and configure your username and email:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
This information will be linked to your commits.
Step 2: Create a New Repository on GitLab
- Log in to your GitLab account.
- Click the "New Project" button.
- Choose "Create blank project".
- Fill in the Project name, visibility level (private, internal, public), and other settings.
- Click Create project.
Once the project is created, GitLab will show you the repository URL (HTTPS or SSH).
Step 3: Set Up SSH Keys (Recommended)
Using SSH provides a secure and passwordless connection.
- Generate a new SSH key:
ssh-keygen -t ed25519 -C "your.email@example.com"
Press Enter through the prompts. Your key will be saved in C:\Users\<YourUser>\.ssh\.
- Copy the public key:
cat ~/.ssh/id_ed25519.pub
Copy the output.
- In GitLab:
- Go to User Settings > SSH Keys.
- Paste the key, give it a title, and click Add Key.
Step 4: Clone the Repository to Your PC
Navigate to the folder where you want to store your local copy and run:
git clone git@gitlab.com:username/repository-name.git
Or use HTTPS (you’ll be prompted for username/password unless you configure a personal access token):
git clone https://gitlab.com/username/repository-name.git
Step 5: Add Files and Make Your First Commit
Navigate into the cloned repo:
cd repository-name
Create or add files, then track and commit them:
echo "# My GitLab Project" > README.md
git add README.md
git commit -m "Initial commit"
Push the changes: git push origin main
Step 6: Sync Changes and Collaborate
To pull new changes from GitLab:
git pull origin main
To push your local changes:
git push origin main
You can now collaborate, manage branches, and integrate CI/CD pipelines using GitLab’s interface.
Final Thoughts
Setting up a GitLab repository on Windows 11 is straightforward and a vital step in modern development workflows. With Git and GitLab configured, you're ready to version control your code, track issues, and automate deployment processes.
If you plan to work with teams or manage multiple environments, explore GitLab’s advanced features like merge requests, pipelines, and project access controls.