Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro ao usar o comando git push local master

Esta aparecendo o seguinte erro no terminal.

git init --bare
Initialized empty Git repository in /media/leandro/96E49064E49047FF/Users/Leandro/Documents/Java/forum/
leandro@Engenharia:/media/leandro/96E49064E49047FF/Users/Leandro/Documents/Java/forum$ git push local master
Enumerating objects: 105, done.
Counting objects: 100% (105/105), done.
Delta compression using up to 4 threads
Compressing objects: 100% (84/84), done.
Writing objects: 100% (105/105), 65.15 KiB | 1.28 MiB/s, done.
Total 105 (delta 17), reused 0 (delta 0)
remote: Resolving deltas: 100% (17/17), 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: 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 /media/leandro/96E49064E49047FF/Users/Leandro/Documents/Java/servidor/
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/media/leandro/96E49064E49047FF/Users/Leandro/Documents/Java/servidor/'
2 respostas

Oi, Leandro, tudo bem?

Você utilizou o git add ., o git status, o git commit... antes de utilizar o git push?

solução!

Fala, Leandro.

Você tá tentando dar push estando em uma pasta que é um repositório remoto (você rodou git init com --bare). Aí não faz sentido mesmo, e deveria dar erro.