Table of Contents
Git Lab Tutorial..................................................................................................................2
Install GitLab using docker command..................................................................................................................2
Install GitLab using docker compose....................................................................................................................2
Git Tutorial
Git Lab Tutorial
Install GitLab using docker command
Pulling and Spinning the container for GitLab: Run the following
command
sudo docker run --detach \
--hostname [Link] \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /var/opt/gitlab/config:/etc/gitlab \
--volume /var/opt/gitlab/logs:/var/log/gitlab \
--volume /var/opt/gitlab/data:/var/opt/gitlab \
--shm-size 4gb \
yrzr/gitlab-ce-arm64v8:latest
This will create a GitLab instance as docker image. Ports can be changed in the above
command
Accessing GitLab Login page
url : [Link]
username: root
password: generate the initial password using the below command
docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
Current Credentials: root/Ay@th!v!1@
Install GitLab using docker compose
Creating a fresh project and pushing to the
GitLab
1. Create the folder for the new project.
nbk@NBK-K0338 Documents % mkdir abee-finance
2. Open the Terminal (Git Bash on Windows) and navigate to the local folder that you
want to sync with your GitLab project. Use the cd command to switch to the folder
in question.
Now you can start the Git process with this command:
git init
nbk@NBK-K0338 Documents % git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global [Link] <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
3. Connect the remote GitLab project with your local directory. Use the following
command, pasting in your GitLab project URL at the end (make sure it ends in .git).
git remote add origin <project link>
git remote add origin [Link]
[Link]
Note: After you press Enter or Return, you won't see any confirmation. That's
because you haven't added or transferred the files to the Git process yet.
4. To add all the files from the current directory to the Git process, use the following
command.
git add .
Then you can check if all files were added correctly using the following command.
git status
5. Now you'll make a commit, so you know which files were included when the local
directory was first uploaded to the GitLab project. You can add your comment
between the quotes at the end of the next command. It can include what changes
you made recently to the code and if you added any new files.
git commit -m "first commit"