Apr. 2nd, 2020

victor_sudakov: (Default)
Стандартная ситуация: основная работа идёт на машине A (рабочая копия и репозиторий - всё вместе). Сделал клон репозитория на машину B, чтобы там поработать. Поработал на B, покоммитил, хочу сделать push на машину A.

Mercurial: сделал push, изменения ушли наверх.

Git: хрен тебе:
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: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.


Не нужен мне bare repository на машине A, там рабочая копия, в которой вся основная работа и идёт. Оказывается есть команда "git config receive.denyCurrentBranch updateInstead", которая в этом месте выпрямляет git и делает его похожим на hg. В вышеприведенном сообщении гита конечно про updateInstead ничего нет.

Profile

victor_sudakov: (Default)
Виктор Судаков

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 15th, 2025 06:50 am
Powered by Dreamwidth Studios