zoukankan      html  css  js  c++  java
  • receive.denyCurrentBranch 推送错误解决

    场景:

           1.搭建Ok了一git服务器

           2.本机上的现有源码,现在想纳入git源码管理

    操作:

          1.服务器上创建了工程仓库

             git init

          2. 客户端使用tortoisegit添加并提交要纳入源码管理的项目,推送远程

            ssh://mygit@192.168.6.70/ISRL/SPDH/EControl.git

           结果报错:

               。。。receive.denyCurrentBranch。。。

    按照网友说法,到服务器仓库目录下执行

    git init --shared --bare

    然后再推送远程服务器,仍然报错(后来本人在做测试,将服务器仓库删除,然后再执行上面命令,客户端推送成功了)

    所以,初始化服务端仓库时,需干净环境下执行

    git init --shared --bare

    最后只能到服务器仓库下执行

    git config receive.denyCurrentBranch ignore

    再推送,显示如下信息,表明推送成功

          

    git.exe push --progress "EControl5.0" master

    Counting objects: 2654, done.
    Compressing objects: 100% (2468/2468), done.
    Writing objects: 100% (2654/2654), 35.92 MiB | 1.84 MiB/s, done.
    Total 2654 (delta 760), reused 0 (delta 0)
    To ssh://mygit@192.168.6.70/ISRL/SPDH/EControl.git
    * [new branch]      master -> master

    成功 (31344 ms @ 2016/4/29 14:10:16)

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/jeffry/p/5446213.html
Copyright © 2011-2022 走看看