01、git安裝與初始化設(shè)置
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ apt install
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git config --global user.name "用戶名"
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git config --global user.email 10086@qq.com
02、生成密鑰并拷貝
生成密鑰
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ ssh-keygen -t rsa -C "your email"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mhzzj/.ssh/id_rsa):
Created directory '/home/mhzzj/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mhzzj/.ssh/id_rsa
Your public key has been saved in /home/mhzzj/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:BenbzPgfLVOb9VGmWsaANDH7nLXKvF8XLfNEibbhHKg your email
The key's randomart image is:
+---[RSA 3072]----+
| ..=. |
| .o =. . .|
| . +..=..+|
| ...o+=+=o|
| SE ++Xo+|
| o +o B O+|
| . O + =|
| . = ..|
| .o.. |
+----[SHA256]-----+
拷貝密鑰到gitee
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ cat /home/mhzzj/.ssh/id_rsa.pub #查看生成的密鑰
ssh-rsa
******
測試密鑰是否生效文章來源:http://www.zghlxwxcb.cn/news/detail-744835.html
hzzj@mhzzj-virtual-machine:~/work/skynetStudy$ ssh -T git@gitee.com
The authenticity of host 'gitee.com (180.76.198.77)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee.com,180.76.198.77' (ECDSA) to the list of known hosts.
Hi mhzzj(@mhz-zzj)! You've successfully authenticated, but GITEE.COM does not provide shell access.
03、創(chuàng)建項(xiàng)目并提交代碼
創(chuàng)建項(xiàng)目
提交代碼文章來源地址http://www.zghlxwxcb.cn/news/detail-744835.html
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git init
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git add .
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git commit -m "basic skynet"
# 注意,使用ssh提交,否則需要輸入賬號和密碼 如果意見add https,可以使用git remote rm origin刪除已有的原創(chuàng)連接
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git remote add origin git@gitee.com:mhz-zzj/skynet-study.git
mhzzj@mhzzj-virtual-machine:~/work/skynetStudy$ git push -u origin "master"
到了這里,關(guān)于linux 創(chuàng)建git項(xiàng)目并提交到gitee(保姆式教程)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!