解决办法: 977down vote You can simply convert your remote repository to bare repository (there is no working copy in the bare repository - the folder contains only the actual repository data). Execute the following command in your remote repository folde…
情景再现 远程新建仓库,然后本地 git bash执行以下代码 git init git add . git commit -m 'xxx' git remote add origin https://username@xxx.com/xxx.git git push 在执行git push的时候出现" The current branch master has no upstream branch."问题的原因是没有将本地的分支与远程仓库的分支进行关联,如图  对应的中文意思: fa…
昨晚在提交一个项目代码时,不小心把数据库备份文件也一起Commit了:到最后Push的时候报错了.最后弄了半天解决了,在此记录下. 如下图,文件有108M. 项目放在第三方托管平台上,根据提示查看了原因.后来看了下像单个文件最大不超过50M. 网上找处理方法,有很多种.比如删除提交过大的文件:git filter-branch --tree-filter 'rm -f 文件名' HEAD 但是这命令我这边执行不行报错:fatal: ambiguous argument 'database_bak…
是因为本地分支和远程分支没有建立联系  (使用git branch -vv  可以查看本地分支和远程分支的关联关系)  .根据命令行提示只需要执行以下命令即可git branch --set-upstream-to=origin/远程分支的名字 本地分支的名字 git无法pull仓库refusing to merge unrelated histories git pull origin master ----allow-unrelated-histories…
参考了两种方法: 1. 解决fatal: unable to connect to github.com问题 http://blog.csdn.net/greenqingqingws/article/details/11808745原因:需要用https才能读到数据解决方法:输入命令git config --global url."https://".insteadOf git:// 2. 使用github出了些问题?fatal: unable to access;Failed con…
原因:上传的文件过大,这里我上传的文件有10G+所以报了上面的错误 解决方法:依次运行:git config --global pack.threads 1 git,git config --global pack.deltaCacheSize 128m,git config --global pack.windowMemory 50m. 注:这几个语句中参数的配置代表的含义不清楚,但是我的错误中报了tried to allocate 82037333 bytes,换算下来是70+M,所以用上面…
今天对代码进行了修改优化,然后往往远程push,但push后报错了 git操作 git add . git commit -m"fix" git push origin master:dev-gaochao 报错信息 To https://amc-msra.visualstudio.com/trading-algo/_git/real-trading ! [rejected] master -> dev-gaochao (fetch first) error: failed to…
今天在使用Git回退到之前某个版本的代码时,进行push时出现如下错误: ! [remote rejected] master -> master (pre-receive hook declined)...... 查阅相关资料发现,是由于当前用户没有push权限,就是[master]代码默认是被保护的,所以进行push的时候会报错; 解决方案: 登录gitlab,选择对应的项目,点击[Setting], 选择[Protected Branches]; 解除[master]的保护即可; push…
在做远程仓库调试阶段,突然发现修改后的项目无法push了: 如果输入$ git remote add origin git@github.com:djqiang(github帐号名)/gitdemo(项目名).git 提示出错信息:fatal: remote origin already exists. 检查发现远程仓库由于项目的需要被手动重命名了: 因此需要重新关联下, 解决办法如下: 1.先输入$ git remote rm origin 2.再输入$ git remote add orig…
git push origin master出现如下错误: Counting objects: , done. Writing objects: % (/), bytes, done. Total (delta ), reused (delta ) remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branc…