gitlab更新代碼時提示:
Please make sure you have the correct access rights
and the repository exists.
解決辦法:
1 找到 .ssh文件夾,編輯模式打開known_hosts,刪除Gitlab中的ip對應的那一串。如果不知道可以直接刪除該文件。
2 在命令行輸入:ssh-keygen -t rsa -C "username" (username為你git上的用戶名)
3 然后一路回車直到看見如下一串。
4 進入目錄:打開 username/.ssh/id_rsa.pub.
5 復制全部內容。
6 打開Gitlab地址,登陸你的賬戶,進入設置(Settings)找到 SSH Keys,在key的輸入框中粘貼復制的keys。
7 點擊Add key。
8 重新提交一次代碼就可以上傳了。