半小时学会上传本地项目到github
source link: http://www.androidchina.net/4478.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、注册github账号
首先需要注册一个github账号,注册地址:https://github.com
接着会来到这
然后会收到一封github发的邮件,进入邮箱验证
二、创建个人的github仓库
验证成功是这样的,然后点击创建仓库
也可以来到个人中心里创建仓库
创建完成好之后是这样子的。创建仓库的时候最好别用中文,不然你的仓库名就会显示 - 这样一条小横线。
三、 配置SSH keys
终端里输入显示隐藏文件:defaults write com.apple.finder AppleShowAllFiles -bool true
关闭:defaults write com.apple.finder AppleShowAllFiles -bool true
输入命令完成之后需要重启Finder桌面顶部苹果logo->强制退出->
就可显示隐藏文件
然后前往个人文件查看有没有 .ssh 文件夹,有的话个人建议删除掉,从新配置
终端里输入指令:mkdir .ssh 创建一个 .ssh 文件夹
cd .ssh 进入刚创建的 .ssh文件夹目录里
输入指令:ssh-Keygen -t rsa -C “youEmail”双引号里填写你的邮箱地址
输入完成之后一直按回车键 中间会提示你要输入密码,不用管一直按回车直到出现这样。
接着输入指令:ls -la 查看 如果输出类似这样的信息,就说明配置成功
输入指令:pbcopy < ~/.ssh/id_rsa.pub 拷贝
登陆github 进入 SSH keys
添加刚刚拷贝的东西
添加完成之后是这样的
然后回到终端输入指令:ssh -T [email protected] 执行完这条指令之后会输出 Are you sure you want to continue connecting (yes/no)? 输入 yes 回车
回到github,刷新网页就可以看到钥匙旁的灰色小圆点变绿,就表明已经添加成功了。
四、上传本地项目到github上
上传项目,这里我是用得github客户端 可以到这里下载 https://desktop.github.com
下载好之后输入用户名 邮箱 密码登陆之后clone刚创建的仓库到本地
接着打开clone到本地的文件夹 将需要上传的项目添加进去这里以FirstRespository文件夹为例,里面放你想要上传的项目
添加之后回到github客户端
然后点击右上角的按钮
提交前是这样的
提交之后是这样的
恭喜你,已经成功的创建一个属于自己的github仓库了。(完)
转载请注明:Android开发中文站 » 半小时学会上传本地项目到github
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK