github 上传代码
2016-06-19 10:29
441 查看
前面创建仓库参考http://www.cnblogs.com/ruofengzhishang/p/3842587.html
创建仓库和验证
ssh -T git@github.com
git clone https://github.com/LianJion/blogmove.git
传输文件阶段
(1)进入对应仓库目录下
Administrator@USER-20151114HY MINGW64
~ (master)
$ cd blogmove
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git init
Reinitialized existing Git repository in C:/Users/Administrator.USER-20151114HY/blogmove/.git/
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git add 'move'
添加move文件夹
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote add origin https://github.com/LianJion/blogmove.git
fatal: remote origin already exists.
出现第一个问题
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote rm origin
解决了
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote add origin https://github.com/LianJion/blogmove.git
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
fatal: unable to access 'https://github.com/LianJion/blogmove.git/': Failed to connect to 127.0.0.1 port 8087: Connection refused
出现第二个问题
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git config --global http.proxy
127.0.0.1:8087
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git config --global --unset http.proxy
解决了
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Everything up-to-date
出现第三个问题:提示更新但是没有上传成功
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Everything up-to-date
问题分析:也就是说一开始 git 服务器仓库是完全空的,
不包含任何一个分支(branch),因此刚开始 Push 时需要指定一个。
执行 git remote -v 后看到自己的 remote 端名字为 origin:
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote -v
origin https://github.com/LianJion/blogmove.git (fetch)
origin https://github.com/LianJion/blogmove.git (push)
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git branch
* master
我感觉就是因为之前没有弄下面这句才错的
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git commit -m 'move'
[master af01149] move
3 files changed, 136 insertions(+)
create mode 100644 move/demo.html
create mode 100644 move/democss.css
create mode 100644 move/hair.jpg
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 5.59 KiB | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To https://github.com/LianJion/blogmove.git
3ca9a0f..af01149 master -> master
成功啦!
参考来源:
http://www.cnblogs.com/ruofengzhishang/p/3842587.html 问题1
http://blog.csdn.net/lly20000/article/details/46903143问题2
http://blog.csdn.net/jiangnan_java/article/details/21192675 问题3
http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=5 (之前遇到)问题4
创建仓库和验证
ssh -T git@github.com
git clone https://github.com/LianJion/blogmove.git
传输文件阶段
(1)进入对应仓库目录下
Administrator@USER-20151114HY MINGW64
~ (master)
$ cd blogmove
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git init
Reinitialized existing Git repository in C:/Users/Administrator.USER-20151114HY/blogmove/.git/
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git add 'move'
添加move文件夹
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote add origin https://github.com/LianJion/blogmove.git
fatal: remote origin already exists.
出现第一个问题
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote rm origin
解决了
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote add origin https://github.com/LianJion/blogmove.git
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
fatal: unable to access 'https://github.com/LianJion/blogmove.git/': Failed to connect to 127.0.0.1 port 8087: Connection refused
出现第二个问题
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git config --global http.proxy
127.0.0.1:8087
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git config --global --unset http.proxy
解决了
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Everything up-to-date
出现第三个问题:提示更新但是没有上传成功
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Everything up-to-date
问题分析:也就是说一开始 git 服务器仓库是完全空的,
不包含任何一个分支(branch),因此刚开始 Push 时需要指定一个。
执行 git remote -v 后看到自己的 remote 端名字为 origin:
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git remote -v
origin https://github.com/LianJion/blogmove.git (fetch)
origin https://github.com/LianJion/blogmove.git (push)
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git branch
* master
我感觉就是因为之前没有弄下面这句才错的
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git commit -m 'move'
[master af01149] move
3 files changed, 136 insertions(+)
create mode 100644 move/demo.html
create mode 100644 move/democss.css
create mode 100644 move/hair.jpg
Administrator@USER-20151114HY MINGW64
~/blogmove (master)
$ git push origin master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 5.59 KiB | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To https://github.com/LianJion/blogmove.git
3ca9a0f..af01149 master -> master
成功啦!
参考来源:
http://www.cnblogs.com/ruofengzhishang/p/3842587.html 问题1
http://blog.csdn.net/lly20000/article/details/46903143问题2
http://blog.csdn.net/jiangnan_java/article/details/21192675 问题3
http://jingyan.baidu.com/album/f3e34a12a25bc8f5ea65354a.html?picindex=5 (之前遇到)问题4
相关文章推荐
- 查看github pages文档的方式
- 使用BAE的基于Web.py的简单博客程序
- 自动共享和上传文件到兼容的托管站点
- 实现FTP整站上传的批处理代码
- asp防止上传图片木马原理解析
- 批处理向FTP上传具有指定属性的文件(增量备份)
- 两分钟学会如何在github托管代码
- 用PHP实现文件上传
- PHP实现多文件上传的方法
- PHP安全上传图片的方法
- php限制上传文件类型并保存上传文件的方法
- 在ASP.NET 2.0中操作数据之五十四:添加新记录时包含一个文件上传选项
- 在ASP.NET 2.0中操作数据之五十二:使用FileUpload上传文件
- C#实现图片上传与浏览切换的方法
- PHP多个文件上传到服务器实例
- JS上传组件FileUpload自定义模板的使用方法
- 通过隐藏iframe实现无刷新上传文件操作
- js实现上传图片及时预览
- js验证上传图片的方法