如何在本地模拟Git向远程推数据?

sbgphl 2014-04-05 08:21:46
在D:盘建立一个Git目录,模拟服务端。
在E:盘建立客户端,向D:盘的服务端拉数据成功。
在本地改完数据后如何向D:盘推数据? 我这一直是不成功的。


git.exe push -v --progress "origin" master

Pushing to E:/GITRoot/MyGitTest/.git
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (11/11), 1.09 KiB, done.
Total 11 (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 E:/GITRoot/MyGitTest/.git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'E:/GITRoot/MyGitTest/.git'


...全文
3526 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lion7beck 2014-06-08
  • 打赏
  • 举报
回复
在本地模拟时,是不能向远程的当前被checked out出的分支push的!楼主可以在远程新建个分支来解决这个问题。 ——“remote: error: refusing to update checked out branch: refs/heads/master”
teemai 2014-04-07
  • 打赏
  • 举报
回复
git pull git commit -a git push

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧