gitlab에서 2FA 인증으로 터미널에서 ID와 PW를(gitlab 로그인 PW) 통해서 로그인이 불가능합니다.

remote: HTTP Basic: Access denied. The provided password or token is incorrect or 
your account has 2FA enabled and you must use a personal access token instead of a 
password

그래서 gitlab edit profile 또는 setting page에 있는 Access Tokens 발급을 해서 진행할 수 있습니다.

Access Tokens 발급 받기

화면 캡처 2022-08-26 105409.png

Access Tokens 항목을 선택하고 Personal Access Tokens에 있는 Token name 작성하고 생성합니다.

화면 캡처 2022-08-26 105709.png

이후에 생성되는 Token을 통해서 터미널에서 아래 명령어 수행하시면 mirror 진행이 됩니다.

git clone —mirror <https://gitlab.com/dev/server/server1.git>

Cloning into bare repository '.'...
Username for '<https://gitlab.com>':  // gitlab login ID
Password for '<https://[email protected]>':  // Access Tokens에서 발급한 PW
remote: Enumerating objects: 4128, done.
remote: Counting objects: 100% (726/726), done.
remote: Compressing objects: 100% (681/681), done.
remote: Total 4128 (delta 433), reused 61 (delta 29), pack-reused 3402
Receiving objects: 100% (4128/4128), 4.73 MiB | 9.92 MiB/s, done.
Resolving deltas: 100% (2714/2714), done.