Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2604281
  • 博文数量: 877
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5920
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 12:25
个人简介

技术的乐趣在于分享,欢迎多多交流,多多沟通。

文章分类

全部博文(877)

文章存档

2021年(2)

2016年(20)

2015年(471)

2014年(358)

2013年(26)

分类: iOS平台

2015-11-13 20:25:28

0 安装git 命令行工具 在安装Xcode7时会默认安装git,只要安装了Xcode7就不会自己安装git了。
建立链接 SSH keys
-> ssh-keygen -t rsa
->pbcopy < ~/.ssh/id_rsa.pub    //把公匙复制到Mac剪切板,直接将其添加到github网站的SSH选项里面
1 先建立本地和github的ssh链接问题,执行上面两条命令复制到github网站即可,保证ssh -T git@github.com 能通过,然后在github网站上新建一个repository
例如新建的repository名字为thred  建好后点击SSH git@github.com:jeffasd/thred.git  复制 git@github.com:jeffasd/thred.git 这个地址后面有用。
2 在本地新建个文件夹名字随便起 在Terminal 进入此文件夹,在此文件夹下执行如下命令:
git config --global user.email "xxxxx@126.com"
git config --global user.name "jeffasd"

echo "# thred" >> README.md 
git init git add README.md 
git commit -m "first commit" 
git remote add origin git@github.com:jeffasd/thred.git 
git push -u origin master
 
执行此命令后本地的文件夹下的全部内容就会上传到github
到此上传github的工作就完成了。
--------------------------------------------------------------------华丽的分割线
本地直接clone 的方法为:
git clone git@github.com:jeffasd/thred.git 

…or push an existing repository from the command line

git remote add origin git@github.com:jeffasd/thred.git 
git push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.




阅读(608) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~