1.2.使用Git命令下载远程仓库到本地

1.2.使用Git命令下载远程仓库到本地

HTTP(S)获取远程仓库

首次拉取

git clone 版本库地址 [本地文件夹名称]

更新代码

git pull

临时记住密码

  • git config –-global credential.helper cache #默认缓存15分钟
  • git config credential.helper ‘cache –timeout=3600’ #自定义配置记住 1 小时的命令

永久记住密码

git config –global credential.helper store
修改配置文件.gitconfig

[credential]
    helper = store

在上面的命令中,如果没有–global,则会在当前项目下的.git/config文件增加配置

SSH拉取

git clone git@gitee.com:xxx/xxxx.git xxxx

创建一个ssh key

执行命令: ssh-keygen 之后一直回车

查看公钥

cat ~/.ssh/id_rsa.pub

添加公钥到服务器

把公钥粘贴上去