一个Git客户端如何从github或者git@osc分别clone项目

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ldz_wolf/article/details/53823037

参考:

  1. 如何将项目同时托管到 Git@OSC 和 GitHub:http://m.blog.csdn.net/article/details?id=50888313
  2. Git 的一些基本名词/概念/常用命令解释以及实例:http://git.mydoc.io/?t=83145

一、在github上建立远程仓库

  1. 我已经和github建立了连接,可以将自己的代码托管到github,如果您还没有建立和github的关联,你可以廖雪峰老师的:远程仓库
  2. 建立github远程仓库时,想必已经建立了一套公钥了,现在我们把该公钥同样使用在git@osc中。是不是和github中一样的。把公钥中进去之后,我们就得到授权了。
    这里写图片描述

找一个项目来测试一下,我选择的是:Jeesite。在本地新建一个Jeesite文件夹,在该文件夹中打开 git bash。如图依次执行
这里写图片描述

git init 初始化本地仓库
git remote add gitosc [email protected]:luodz/jeesite.git 关联远程仓库
git clone [email protected]:luodz/jeesite.git 下载代码
git remote -v 查看远程仓库
git remote rm gitosc 移动远程仓库

猜你喜欢

转载自blog.csdn.net/ldz_wolf/article/details/53823037