Share
Explore

Committing a Simple Python Program to GitLab and Opening an Issue

Student Learning Activity Sheet:
Title: Committing a Simple Python Program to GitLab and Opening an Issue
Objective:
To learn how to commit a simple Python program to GitLab and open an issue
To gain an understanding of the basic GitLab workflow
Prerequisites:
Basic knowledge of Python programming
A GitLab account
Git command-line tools installed on your computer ​
Step 1: Create a new repository on GitLab
Log in to your GitLab account and click on the "+" button on the top right corner
Select "New repository"
Fill in the repository name, description, and visibility level (e.g. "my-python-project", "A simple Python program", "private")
Click on "Create repository"
Step 2: Clone the repository to your local machine
Copy the repository's URL (e.g. "")
Open the command-line interface (CLI) and navigate to the directory where you want to store the project
Type "git clone [repository URL]" (e.g. "git clone ") and press enter
This will create a new directory with the same name as the repository and download all the files from the remote repository to your local machine
Step 3: Create a new Python file
Navigate to the repository directory on your local machine (e.g. "cd my-python-project")
Create a new file named "main.py" and add the following code:
Copy code
print("Hello, GitLab!")

Save the file
Step 4: Commit the changes to the local repository
Type "git status" in the CLI to check the status of the repository
You should see "main.py" as an untracked file
Type "git add main.py" to stage the changes
Type "git commit -m "Initial commit: added main.py"" to commit the changes to the local repository
Step 5: Push the changes to the remote repository
Type "git push" in the CLI to push the changes to the remote repository
You will be prompted to enter your GitLab credentials
Once the changes are pushed, you should be able to see the "main.py" file on the GitLab website
Step 6: Open an issue
On the GitLab website, navigate to the repository and click on the "Issues" tab
Click on the "New issue" button
Fill in the title and description of the issue (e.g. "Feature request: add command-line arguments", "I would like to add the ability to pass command-line arguments to the program")
Click on "Submit issue"
Congratulations! You have successfully committed a simple Python program to GitLab and opened an issue.
Note: This is a very basic example of how to use GitLab and git commands, but you can use this as the foundation for more complex projects.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.