Task
Import Exported zip archive of a repository into new development Gitlab.
Notes:
- Development Gitlab is self-certified, need to accept certificate or override
- Gitlab has default "main" branch protected, need to temporarily unprotect, or push to another branch and then issue merge.
Lab Setup:
- User: developer
- Gitlab server: git.ocp4.example.com:8443
- namespace: developer (user)
Steps
1. Create Project:
a. Using Gitlab UI, create project:
- web browser --> login --> Your work --> Projects --> New project (button) --> Create blank project (option)
- On the Create blank project page, enter:
- - Project name: MW-JSDev-Project
- - Project URL (namespace dropdown): <select user or a group>
- - Project slug: mw-jsdev-project
- - Visibility: <keep Private or choose another>
-Project Configuration (heading)
- - Initialize repository with a README: <uncheck>
- - Click Create project (button)
2. Upload expanded zip file:
a. Change to expanded zip folder:
$ cd ~/mw-jsdev-project
b. Initialize/reinitialize folder to use git:
Notes:
- Update your user from developer to your username
- Update the domain and namespace to your Gitlab server and namespace
$ git config --local user.name "Developer MW"
$ git config --local user.email "developer@example.com"
$ git init --initial-branch=main --object-format=sha1
<Initialized empty Git repository in ...>
c. Disable SSL/TLS verification:
- Allow this local git to communicate with this Gitlab which does not have a production certificate:
$ git config --local http.sslVerify false
<no output>
d: Setup origin to point to repo:
$ git remote add origin https://git.ocp4.example.com:8443/developer/mw-jsdev-project
<no output>
e. Add all files, commit, and push to Gitlab repo:
$ git add .
<no output>
$ git commit -m "initial commit of zip transferred files"
<view list of folders and files included>
$ git push --set-upstream origin main
<if ssh key is not configured, enter user developer and the password at prompts>
previous page
|