我看过这么多的资源,但无法找到答案。 我有一个Git仓库。 我已经克隆存储库和我的本地更改。当我把我的更改服务器它的工作原理。 当我创建一个分支,我签出的分支,将我的工作,然后签出master分支。我我的本地更改到主分支。当我尝试推到服务器我得到下面的异常:
Welcome to Git (version 1.7.11-preview20120620)
Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
$ git push origin master:master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 13.68 KiB, done.
Total 8 (delta 2), reused 1 (delta 0)
Unpacking objects: 100% (8/8), done.
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 c:/jGit
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'c:/gitRepository'
一种解决方案是执行
git config receive.denyCurrentBranch ignore
在此之后它的工作原理。但我想知道为什么我需要这个选项。这是唯一的选择吗?什么是这样做的后果。 我真的很想做的是创建分支,将它们合并到主分支,然后把我的更改服务器。
本文地址 :CodeGo.net/499956/
转帖地址:http://codego.net/499956/
相关推荐
Git-2.30.2-32-bit.exe.zip(免积分)Git-2.30.2-32-bit.exe.zip(免积分)Git-2.30.2-32-bit.exe.zip(免积分)Git-2.30.2-32-bit.exe.zip(免积分)Git-2.30.2-32-bit.exe.zip(免积分)Git-2.30.2-32-bit.exe.zip...
Git是目前非常流行的分布式版本控制系统,由Linus Torvalds为Linux内核开发而创建,该资源包含 Git-2.42.0-64-bit-windows安装版,仅供学习,下载后请及时删除 Git是目前非常流行的分布式版本控制系统,由Linus ...
最新版windows Git-2.33.1-64-bit.exe最新版windows Git-2.33.1-64-bit.exe
Git-2.15.1.2-64-bit和Git-2.15.1.2-32-bit以及常用命令行git-cheatsheet.PDF
Git-2.42.0.2-64-bit.ex
Git-2.41.0.3-64-bit.exe
git-2.35.1官方git软件包
git-bash.exe
Git-2.39.2-64-bit.exe Git是一个免费的开源分布式版本控制系统,可以快速高效地处理从小...它超越了像Subversion、CVS、Perforce和ClearCase这样的配置管理工具,具有简易的本地分支、方便的暂存区和多工作流等特性。
用户Linux系统的net-tools-2.0-0.25.20131004git.el7.x86_64.rpm文件
GIT服务器配置.pdf
Git-2.24.0.2-64-bit.exe 国外站点下载异常慢,上传一个,节约你宝贵的时间。 介绍 这些发行说明描述了特定于Windows的Git版本的问题。可以在Git项目中找到涵盖核心git命令历史的发行说明。 有关Git的更多详细...
git-2.23.0.tar.xz 国内下载有时特别慢, 需要快点下载的拿去吧
Git-2.15.1.2 window 32bit 和 64bit,官方绿色版,更新于2017/11/30
git工具 最新版本 Git-2.15.1.2-64-bit windows 64位系统
Git-2.24.0.2-64-bit最新版64位.国外站点太慢了,节约大家时间。Git-2.24.0.2-64-bit;Git 2.24 64位最新版; Feature: 1、Branching and Merging 2、Small and Fast 3、Distributed 4、Data Assurance 5、Staging ...
博客有写安装和环境变量配置方式 Git-2.26.2-64-bit.exe.7zGit-2.26.2-64-bit.exe.7zGit-2.26.2-64-bit.exe.7zGit-2.26.2-64-bit.exe.7z
Git-2.37.3-64-bit_3
win 平台的git 下载地址。官方下载地址:https://github.com/git-for-windows/git/releases/download/v2.17.1.windows.2/Git-2.17.1.2-64-bit.exe 如果能官网下载,就没必要在这下载了,这里只是提供由于特殊原因不...
Git-2.29.2.3-64-bit.exe (免积分)Git-2.29.2.3-64-bit.exe (免积分)Git-2.29.2.3-64-bit.exe (免积分)Git-2.29.2.3-64-bit.exe (免积分)Git-2.29.2.3-64-bit.exe (免积分)Git-2.29.2.3-64-bit.exe (免积分)Git-2.29...