用TortoiseGit进行push时报如下错:
git.exe push --progress "origin" master:master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 528 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To D:\test
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'D:\test'
解决方案:
1、用TortoiseGit创建仓库时,选择Make it Bare.
2、在.git/config中添加如下代码:
[receive]
denyCurrentBranch = ignore
分享到:
相关推荐
Git push 常见用法,git里面help 可以帮助我们查看。这个文档只是补充。。
彻底解决Mac端git clone/push速度太慢的问题,详情请参阅文档。
解决git clone时报错问题:sign_and_send_pubkey: signing failed: agent refused operation
git-remind是一个命令行工具,可以防止你忘记git-commit和git-push
git-fatal the remote end hung up unexpectedly 解决方法
如何用git将本地项目push到GitHub上?如何用git将本地项目push到GitHub上?
git-push-deploy:搭建一个你能够git push部署的远程repo
当你辛辛苦苦地在Linux下架设好SSH服务器,给账户分配完权限,以为什么都大功告成的时候。 这时你在客户端的Linux机器下登陆,可是可是,... remote:error:blablabla remote:error:blablabla remote:error:blablabla
取消git每次push都要输入用户名和密码
开源项目-bobbo-git-s3-push.zip,git-s3-push: Deploy git repos to Amazon S3, written in Go
内容概要: 使用git命令, 先执行pull命令将云端仓库内容同步到本地, 后执行push命令将本地仓库文件上传到云端仓库; 适用人群: git命令使用者; 使用方法: 将本文件放入git clone 后的本地仓库内. 点击后一键执行; ...
Gitpush node.js 脚本 git push aremote abranch 吗和gitpush(假设源主) 或者gitpush abranch(假设源远程) 或者gitpush 分支远程 安装 git 克隆cd gitpush npm 链接
git push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push ...
同时push到GitHub和Gitee
git-push-pr 在默认浏览器中的Git推送和打开拉取请求(适用于GitHub,GitLab和Bitbucket) 安装 npm install --global git-push-pr 用法 gppr --help Usage gppr [options] Options --remote, -r Specify ...
git-push-test 验证提供的解决方案可在库中使用 命令在测试时运行: git标签<标签> <提交> -m <标签> git获取来源 git merge origin master -m“ <提交-msg>” git推 git push-标签 提交 确认: ...
git 推送部署 它用于 git push 部署
taco-git-push-deploy git push与部署 npm install -g taco-git-push-deploy 用法 首先进入您要使用git push部署的应用程序 cd my-app 确保此应用具有包含name字段的package.json。 然后跑 # substitute maf@...
git-push-each 将一个分支中的所有提交推送到自己的分支,一次提交一个! \o/ 什么为什么!? 因为有时你需要欺骗 Github 和 CI 服务器来单独测试每个提交。 好处是很好,每次提交指标。 安装 git clone ...
elipse egit 插件 使用git来pull push 需要配置的内容特别是master的2行