ubuntu下git的安装及上传文件
2015-12-09 15:45
399 查看
1、在ubuntu的终端安装git
2、配置ubuntu系统的git账户
3、生成密钥, 按三次回车,秘钥默认路径/root/.ssh/
4,命令生成后,可以在/root/.ssh/文件夹下,找到公钥文件,
然后我们需要新建一个无后缀名的config文件,把里面加入如下内容,为了防止连接github失败。
5、提交密钥,查看并复制秘钥
打开 https://github.com/网页,登陆自己的账号,点击右上角的头像,选择Settings,找到左边的SSH keys,单击Add SSH keys,Title可以随意输入,复制密钥(cat /root/.ssh/id_rsa.pub),单击Add key并再次输入github的密码。
6、检验是否链接上了github
7、提交,上传你的工程步骤
①、进入你的工程目录,输入git init,创建git仓库
②、git add [file],(file可以是文件名也可以是文件夹)
③、git commit -m ‘you introduction’
④、git remote add origin git@github.com:yourname/yourprojectname.git
⑤、git push -u origin master将你的文件上传到github
参考文档:
http://www.tuicool.com/articles/j2iqaa
http://blog.sina.com.cn/s/blog_63eb3eec0101cf6x.html
/article/1409811.html
/article/6055965.html
http://www.xuebuyuan.com/zh-tw/2025269.html
http://www.xuebuyuan.com/651322.html
/article/3491307.html
sudo apt-get install git git-core
2、配置ubuntu系统的git账户
git config --global user.name "abc" git config --global user.email abc@xxxx.com
3、生成密钥, 按三次回车,秘钥默认路径/root/.ssh/
ssh-keygen -t rsa -C "abc@xxxx.com" //邮箱同上
4,命令生成后,可以在/root/.ssh/文件夹下,找到公钥文件,
然后我们需要新建一个无后缀名的config文件,把里面加入如下内容,为了防止连接github失败。
Host github.com User git Hostname ssh.github.com PreferredAuthentications publickey IdentityFile /root/.ssh/id_rsa Port 443
5、提交密钥,查看并复制秘钥
cat /root/.ssh/id_rsa.pub
打开 https://github.com/网页,登陆自己的账号,点击右上角的头像,选择Settings,找到左边的SSH keys,单击Add SSH keys,Title可以随意输入,复制密钥(cat /root/.ssh/id_rsa.pub),单击Add key并再次输入github的密码。
6、检验是否链接上了github
ssh -t git@github.com //正常情况下,回显如下 PTY allocation request failed on channel 0 Hi plinx! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.
7、提交,上传你的工程步骤
①、进入你的工程目录,输入git init,创建git仓库
②、git add [file],(file可以是文件名也可以是文件夹)
③、git commit -m ‘you introduction’
④、git remote add origin git@github.com:yourname/yourprojectname.git
⑤、git push -u origin master将你的文件上传到github
参考文档:
http://www.tuicool.com/articles/j2iqaa
http://blog.sina.com.cn/s/blog_63eb3eec0101cf6x.html
/article/1409811.html
/article/6055965.html
http://www.xuebuyuan.com/zh-tw/2025269.html
http://www.xuebuyuan.com/651322.html
/article/3491307.html
相关文章推荐
- 夺命雷公狗---Smarty NO:05 设计篇3 变量调节器
- Three.Js教程
- 【JavaWeb】之过滤器Filter
- mongo 附近的点按指定字段排序
- leetcode -- Min Stack -- 简单重点
- python使用函数默认值来实现函数静态变量的功能
- android程序安装后在模拟器上不显示,并且控制台显示The launch will only sync the application package on the device!
- NetFlow网络流量监测技术的应用和设计(转载)
- 1209 实验三同学评论
- Python weatherforecast
- IOS 后台执行
- ajax 上传文件 demo
- python一个发邮件的函数
- JAVA中的final关键字用法实例详解
- 编辑距离问题算法分析
- sftp上传文件代码
- Android图表生成类库Demo
- Gh0st启动流程
- 12 9同学作业评论
- linux下DMA驱动测试代码