Explore Git and GitLab through practical exercises. Java 8, Jenkins, Docker, and Container Registry are client-environment context only.
Getting Started with Git & GitLab
Feature branch → Merge Request → develop
Scenario: update the approved Stacks customer-search policy document, commit locally, push to GitLab, and open a Merge Request. The simulator uses README as a simple visual example; the live exercise uses docs/CUSTOMER_SEARCH_POLICY.md.
Working tree
clean
→
Staging
empty
→
Local commit
0
→
Remote
none
Step 1: Update develop before branching.
Begin by updating your local develop branch.
Working Together in GitLab
Working Together in GitLab
GitLab lets developers review changes before they reach shared branches. In this session you practise the Merge Request lifecycle and understand branch governance.
Feature branch
Developer pushes work
→
Merge Request
Source: feature/* Target: develop
→
Review
Comments, changes, approval
→
Merge
After required checks
Participant checklist
Push a feature branch to the training repository.
In GitLab, open Merge requests → New merge request.
Choose your feature branch as source and develop as target.
Write a useful title, change summary, and test evidence.
Ask a peer to review and reply to a review comment.
Merge only when permissions and required checks allow.
Governance to observe
Protected branches: restrict direct pushes to develop, staging, and main.
Approvals: requirements depend on the GitLab edition and project settings.
Automated checks: Jenkins status needs integration and merge checks to be configured; it is not automatic.
Trainer demonstration: Show both the Changes and Overview tabs of an MR, create a review comment, and explain why self-approving or bypassing branch rules is discouraged.
Common Git Problems & Solutions
Conflict lab: two developers, one line
Two contributors independently change the same line of the README. Git needs you to choose the intended result. Resolve it based on the business requirement, not whose edit arrived first.
Developer A • merged into develop
System Name
Stacks Customer Platform
Developer B • pending feature MR
System Name
Stacks Business Platform
<<<<<<< HEAD (develop) System Name: Stacks Customer Platform ======= System Name: Stacks Business Platform >>>>>>> feature/business-name
Unresolved: Git cannot automatically choose between competing edits.
GitLab in Real Projects
GitLab in Real Projects — Client Environment Overview
Architecture context only: GitLab and Jenkins are hosted in Docker containers. The client application uses Java 8; Jenkins may build/test it. GitLab Container Registry may optionally store built images. You do not need to operate any of these technologies in this workshop.
Training focus: Git commands, GitLab branches, Merge Requests, reviews and safe recovery. Not taught: Java programming, Jenkins pipelines, Docker operations or publishing images.
Developer + Git
Commit and push changes
→
GitLab (Docker)
Git repository, MRs, approvals
→
Jenkins (Docker)
Optional external build/test status
→
GitLab Registry
Optional container-image storage
The registry is for images, not Git commits. This diagram is a conceptual workflow, not a validated deployment or mandatory build sequence.
Select a pipeline outcome. Deployment is blocked until checks succeed.
Common Git Problems & Solutions
What should the developer do?
Select a situation to show its safer response. Read the situation, decide what you would do, then reveal the safer response.
Select a scenario to see diagnostic commands, recovery commands, and safety notes.
GitLab Best Practices & Wrap-up
GitLab Best Practices & Knowledge Check
Choose an answer.
Before the quiz: Check your branch with git status, review changes before staging, use meaningful commits, create Merge Requests, respect protected branches, and never commit secrets. Keep 10 minutes for Q&A.
Hands-on GitLab Practice
Hands-on challenge: work with a real GitLab repository
Recommended: use GitLab.com or an existing GitLab service for the workshop. A self-managed GitLab instance may be resource-heavy for your 4-core/8-thread, 16 GB RAM Proxmox host, especially alongside Jenkins. Start with the simulator first.
Before you begin
Install Git and make sure you can run git --version.
Get your Java 8 / Jenkins training project URL and access from the instructor.
Configure your Git display name and email using git config --global.
Use only the training repository and sample content provided in the workshop.
Your mission: create your own feature branch, edit CustomerService.java plus CustomerServiceTest.java, run mvn -B test, push, and open a Merge Request targeting develop. Do not merge unless the instructor permits it.
Live Git commands
Run these steps in your terminal. Replace the repository URL and YOURNAME before running.
Lines beginning with # are instructions, not commands. Review each command before execution.
In GitLab: Code → Merge requests → New merge request; source = feature branch, target = develop. Assign reviewer, inspect changes, merge after approval/checks.
Partner exercise: with instructor approval, you and a partner edit the same App.java title line on separate branches. Observe a conflict and agree on the correct final wording before resolving it. Use sample data only.
The first simulator exercise uses README.md only as a conceptual example. The real Java 8 lab uses the project Java source and JUnit tests. Jenkins DEV/STAGING/PRODUCTION stages are echo simulations; merge blocking needs separate GitLab/Jenkins status integration.