标签:意义 lis ubunt shel 保存 wan 一个 print 仓库
$sudo apt-get update -y
$sudo apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.25.1-1ubuntu3).
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
$git --version
git version 2.25.1
// 配置名称与邮箱
$git config --global user.name "jarry_hum"
$git config --global user.email "g15888660315@gmail.com"
// 查看.gitconfig 来验证配置
$git config --list
user.name=jarry_hum
user.email=g15888660315@gmail.com
$ssh-keygen -C ‘g15888660315@gmail.com‘ -t rsa
$cd ~/.ssh //进入用户目录下的.ssh
$vim id_rda.pub //把公钥复制出来,复制到https://gitee.com/profile中
$ssh -T git@gitee.com
The authenticity of host ‘gitee.com (212.64.62.174)‘ 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,212.64.62.174‘ (ECDSA) to the list of known hosts.
$git init //初始化一个仓库
$touch README.md
$git add . //将所有文件添加到仓库,这个步骤想一个标记,一个文件只需要标记一次
$git commit -m "描述" //真正意义上的上传,保存到本地完成
//保存到远端,github上同理
$git remote add origin https://gitee.com/jarryhum/firsttest.git //设置一个远端地址
$git push -u origin master //push一下就上传好了,注意首次需要验证账号密码
git安装,以及远程上传到gitee,(环境是wsl2, Ubuntu 20.04 LTS)
标签:意义 lis ubunt shel 保存 wan 一个 print 仓库
原文地址:https://www.cnblogs.com/jarryHu/p/13286185.html