
Git 服务器已安装了, 客户端是TortoiseGit
From git.gajah.com.sg:bin.hua/inkcase3510_setup
= [up to date] master -> origin/master
You asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
git 未能顺利结束 (退出码 1) (2562 ms @ 2014-8-25 14:48:31)其实最主要的原因就是文件太大
首先尝试
git push -f origin master报错
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date如果code = 411,则是由postBuffer引起的,可以在客户端执行
改为最大50M
git config --global http.postBuffer 52428800
windows:
在 .git/config 文件中加入
[http]
postBuffer = 524288000
linux:
git config http.postBuffer 524288000解决方法其实能通过ssh提交来解决,实在没办法,我使用ssh来提交,而不用之前的http方法,最后证明可行。
使用ssh提交代码,比使用http不但能解决413的大文件报错,同时还能提高提交代码的速度,从我提交的速度来看,他最少能够提升100%的速度,所以还是使用ssh吧。
git客户端输入ssh-keygen -t rsa -C “你的邮箱地址”
Enter file in which to save the key (C:\Users\Administrator.ssh\id_rsa): #不填直接回车
Enter passphrase (empty for no passphrase): #不设置密码直接回车
Enter same passphrase again: #不设置密码直接回车
Your identification has been saved in C:\Users\Administrator.ssh\id_rsa. #生成的密钥位置
Your public key has been saved in C:\Users\Administrator.ssh\id_rsa.pub. #生成的公钥位置
使用记事本打开C:\Users\Administrator.ssh\id_rsa.pub
复制上述文件中的内容到gitee -->设置 -->ssh公钥

使用git remote -v查看当前地址
使用git remote set-url origin ssh://git@github.com:test/ionic3_demo.git切换协议
随后跳出此代码则设置成功You’ve successfully authenticated, but GitHub does not provide shell access