1
resposta

Erro ao tentar fazer push pra servidor local

Ao tentar fazer um push para uma pasta que criei como exemplo de servidor local ocorreu esse erro poderiam me dar um apoio?

Erro

git push server master Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Delta compression using up to 8 threads Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 409 bytes | 409.00 KiB/s, done. Total 3 (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: 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'. To C:/Users/Lucas/mesa_dev/git-github/servidor/ ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to 'C:/Users/Lucas/mesa_dev/git-github/servidor/

1 resposta

Olá Lucas, tudo bem? Bem confere os comandos e os nomes das pasta, porque o erro parece que é porque a pasta servidor não foi inicializada com a flag --bare, então você pode excluir a pasta servidor e criar novamente e depois executar esse comando dentro da pasta:

git init --bare

Espero ter ajudado!