Git官网html
具体操做省略linux
由于Git使用SSH链接,而SSH第一次链接须要验证GitHub服务器的Key。确认GitHub的Key的指纹信息是否真的来自GitHub的服务器。解决办法。其实就是在本地生成key配置到github服务器。git
1)、在前面安装好的git bash中使用命令: ls -al ~/.sshgithub
2)、使用命令: ssh-keygen -t rsa -C "github用户名",按三次回车web
3)、查看生成的key:cat ~/.ssh/id_rsa.pubwindows
4)、登录github,复制新生成的SSH配置到服务器,bash
1):打开git bash ,cd进入你放项目文件的地址,个人地址在D:xxxxx项目服务器
2):输入git init 这个意思是在当前项目的目录中生成本地的git管理(会发如今当前目录下多了一个.git文件夹)ssh
3)输入git add .post
4)输入git commit -m "测试",表示你对此次提交的注释,双引号里面的内容能够根据我的的须要
5)这里若是出现如下内容,则须要你输入本身的帐号或名字
6)用上面提示的代码输入本身的邮箱或名字
7)再输入git commit -m "测试"时就会成功
8)上传到github远程仓库
git remote add origin (你以前在github上复制的连接)git@github.com:test.git
git push -u origin master
注意若是此处上传失败
出现错误的主要缘由是github中的README.md文件不在本地代码目录中
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=4)
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=4)
能够经过以下命令进行代码合并【注:pull=fetch+merge]
git pull --rebase origin master
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=5)
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=5)
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=6)
[](https://link.jianshu.com?t=http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=6)
一、Git提交代码发生LF will be replaced by CRLF in 问题缘由是须要提交的文件是在windows下生成的,windows中的换行符为 CRLF, 而在linux下的换行符为LF,因此在执行add . 时出现提示,解决办法:git config --global core.autocrlf false再执行git 提交二、fatal: sha1 file '<stdout>' write error: Broken pipe git push会出现一个问题:就是关于文件的大小!由于github的默认大小是100M,若是你的文件大于100M,那么你就不能成功,会出现这个:fatal: fatal: sha1 file '<stdout>' write error: Broken pipe The remote end hung up unexpectedly error解决办法为:git config http.postBuffer 52428800 把大小配的大些便可