Advertisement
edrx

Problem with git-push (newbie)

Aug 25th, 2013
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.76 KB | None | 0 0
  1. rm -Rf /tmp/public/
  2. mkdir  /tmp/public/
  3. cd     /tmp/public/
  4. echo 0 > VERSION
  5. git init
  6. git add VERSION
  7. git commit -a -m 'Create empty repo'
  8.  
  9. rm -Rf /tmp/here/
  10. mkdir  /tmp/here/
  11. cd     /tmp/here/
  12. git clone /tmp/public/ .
  13. echo 1 > VERSION
  14. echo 2 > otherfile
  15. git add VERSION otherfile
  16. git commit -a -m 'Version 1'
  17. git push
  18. #   ^ error messages:
  19. # Counting objects: 6, done.
  20. # Delta compression using up to 4 threads.
  21. # Compressing objects: 100% (2/2), done.
  22. # Writing objects: 100% (4/4), 288 bytes, done.
  23. # Total 4 (delta 0), reused 0 (delta 0)
  24. # Unpacking objects: 100% (4/4), done.
  25. # remote: error: refusing to update checked out branch: refs/heads/master        
  26. # remote: error: By default, updating the current branch in a non-bare repository        
  27. # remote: error: is denied, because it will make the index and work tree inconsistent        
  28. # remote: error: with what you pushed, and will require 'git reset --hard' to match        
  29. # remote: error: the work tree to HEAD.        
  30. # remote: error:        
  31. # remote: error: You can set 'receive.denyCurrentBranch' configuration variable to        
  32. # remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into        
  33. # remote: error: its current branch; however, this is not recommended unless you        
  34. # remote: error: arranged to update its work tree to match what you pushed in some        
  35. # remote: error: other way.        
  36. # remote: error:        
  37. # remote: error: To squelch this message and still keep the default behaviour, set        
  38. # remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.        
  39. # To /tmp/public/
  40. #  ! [remote rejected] master -> master (branch is currently checked out)
  41. # error: failed to push some refs to '/tmp/public/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement