美文网首页
用git从远程服务器clone 项目到本地

用git从远程服务器clone 项目到本地

作者: 乡下秋草 | 来源:发表于2017-07-05 22:47 被阅读97次

1.获取本机的SSH 串

在终端输入

ssh-keygen -t rsa -C "forwhat.cn"//注意。forwhat.cn为用户名

如果执行成功。返回

Generating public/private rsa key pair.
Enter file in which to save the key (/home/forwhat.cn/.ssh/id_rsa): 

点击回车

Enter passphrase (empty for no passphrase):

再点击回车

Enter same passphrase again:

再次点击回车

Your identification has been saved in /home/forwhat.cn/.ssh/id_rsa.
Your public key has been saved in /home/forwhat.cn/.ssh/id_rsa.pub.

再在终端输入

cat /home/forwhat.cn/.ssh/id_rsa.pub

就得到本机的ssh 串,去GitHub里添加


GitHub 截图

则本机 SSH串配置完成

2.建立本地仓库

在桌面建立一个文件夹,在终端 cd 该文件夹路径

初始化git

git init

配置git

git config --global user.name "your_username"  
git config --global user.email your_email@domain.com 

克隆远程服务器项目

git clone git@github.com:yourName/yourProject.git
\\yourName 用户名   yourProject 项目名

至此该项目已克隆到本地

相关文章

  • Git 的使用

    1.从远程库克隆到本地 git clone url.git clone到指定目录 Git clone url...

  • git的基本使用

    标签(空格分隔): git 获取远程仓库的项目到本地 使用 git clone 远程仓库地址 (如果使用 git ...

  • ios git常规操作

    1.git从本地文件链接到远程仓库的方法,远程仓库为空 2.git将远程仓库clone到本地的方法 clone成功...

  • git的简单使用

    git clone 地址 //从服务器克隆项目到本地git pull origin 当前分之名称 //例如...

  • Git 基础操作

    一、Clone 远程代码到本地 到 https://{项目}.git 拷贝项目代码到本地 二、修改项目 拉取最新代...

  • 用git从远程服务器clone 项目到本地

    1.获取本机的SSH 串 在终端输入 如果执行成功。返回 点击回车 再点击回车 再次点击回车 再在终端输入 就得到...

  • Git基本操作

    (一) 从远程仓库克隆(拉取)项目到本地 $ git clone [remote_url] 成功执行后, 本地就已...

  • git 常用命令

    1. 拉取远程分支到本地 如果本地没有代码,首先需要git clone项目到本地,此时clone下来的是maste...

  • Git常用命令

    git clonegit clone git clone ssh://git@xxx.xxx.git克隆远程到本地...

  • 常用命令行总结

    Git : // 初始化git git init // 从远程仓库下载代码到本地 git clone https:...

网友评论

      本文标题:用git从远程服务器clone 项目到本地

      本文链接:https://www.haomeiwen.com/subject/djrchxtx.html