Ray's Blog Ray's Blog
首頁
  • 前端文章

    • Vue
    • Markdown
  • Laravel
  • CloudFlare
  • 設計
關於
  • 網站
  • 分類
  • 標籤
  • 歸檔

Ray Chien

Lets learning togeter
首頁
  • 前端文章

    • Vue
    • Markdown
  • Laravel
  • CloudFlare
  • 設計
關於
  • 網站
  • 分類
  • 標籤
  • 歸檔
  • 技術文件

    • CloudFlare Pages
    • Git Clone from GitLab
  • DevOps
  • 技術文件
Ray Chien
2021-06-15

Git Clone from GitLab

如果你想要抓下gitlab上的專案,做法跟github是一樣的

你需要在gitlab網站上複制你要clone下來的連結

我這裡是用Clone with SSH,指令如下:

git clone git@gitlab.com:myproject/official-website.git
1

但如是你是第一次clone gitlab的專案你可能會得到以下錯誤訊息

Cloning into 'official-website'...
git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

1
2
3
4

原因是你必需在gitlab的網站上,加入你目前開發環境的ssh key

那如何產生ssh key呢?

我在mac開發裝置上打開terminal

然後鍵入 ssh-keygen

ssh-keygen
1

接著就會有底下個步驟,你可以都enter跳過

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/rahulwagh/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/rahulwagh/.ssh/id_rsa.
Your public key has been saved in /Users/rahulwagh/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Okq3w+SesCGLQVToSBQru8RdUZtT2EIIrzH5MQ67DWA rahulwagh@local
The key's randomart image is:
+---[RSA 3072]----+
|.ooo..+oo.       |
| oo o..o+.       |
|=E = = +.        |
|*oo X o .        |
|.+ = o  S        |
|o.  + ..         |
|o ..+=+          |
| o + *++         |
|. . o.+.         |
+----[SHA256]-----+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

接下來你就可以在 /Users/ray/.ssh/ 路徑下找到 id_rsa.pub 這個ssh publick key file

然後把這檔案的內容複製下來貼在gitlab - ssh keys

然後再重新執行一次 git clone 專案路徑

就可以啦

#Git#GitLab
最後更新時間: 2021/06/15, 08:16:58
CloudFlare Pages

← CloudFlare Pages

最近更新
01
Home
02
使用JWT來做WEB API驗證
05-13
03
建立第一支Laravel CRUD應用程式
05-11
更多文章>
Copyright © 2021-2021 Ray Chien | License
  • 參照系統
  • 淺色模式
  • 深色模式
  • 閱讀模式
×