git дерьмо
Apr. 2nd, 2020 03:44 pmСтандартная ситуация: основная работа идёт на машине A (рабочая копия и репозиторий - всё вместе). Сделал клон репозитория на машину B, чтобы там поработать. Поработал на B, покоммитил, хочу сделать push на машину A.
Mercurial: сделал push, изменения ушли наверх.
Git: хрен тебе:
Не нужен мне bare repository на машине A, там рабочая копия, в которой вся основная работа и идёт. Оказывается есть команда "git config receive.denyCurrentBranch updateInstead", которая в этом месте выпрямляет git и делает его похожим на hg. В вышеприведенном сообщении гита конечно про updateInstead ничего нет.
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 ничего нет.