git - "Not all refs have been pushed" Error in SmartGIt -


being total noob, not able work smartgit @ all. git terminologies confusing.

here did, created 2 repositories, repo1, , repo2 in smartgit

  1. initialized repo1 git
  2. cloned repo1 repo2
  3. added text file in repo1 , added text it.
  4. pulled repo2
  5. made few changes in text file
  6. committed
  7. now when trying push these changes repo1 getting "not refs have been pushed" error"

update:

push: not refs have been pushed.     'master' rejected (non-fast-forward)     counting objects: 10, done.     delta compression using 2 threads.     compressing objects:  20% (1/5)        compressing objects:  40% (2/5)        compressing objects:  60% (3/5)        compressing objects:  80% (4/5)        compressing objects: 100% (5/5)        compressing objects: 100% (5/5), done.     writing objects:  12% (1/8)        writing objects:  25% (2/8)        writing objects:  37% (3/8)        writing objects:  50% (4/8)        writing objects:  62% (5/8)        writing objects:  75% (6/8)        writing objects:  87% (7/8)        writing objects: 100% (8/8)        writing objects: 100% (8/8), 726 bytes, done.     total 8 (delta 0), reused 0 (delta 0)     remote: error: refusing update checked out branch: refs/heads/master     remote: error: default, updating current branch in non-bare repository     remote: error: denied, because make index , work tree inconsistent     remote: error: pushed, , require 'git reset --hard' match     remote: error: work tree head.     remote: error:      remote: error: can set 'receive.denycurrentbranch' configuration variable     remote: error: 'ignore' or 'warn' in remote repository allow pushing     remote: error: current branch; however, not recommended unless     remote: error: arranged update work tree match pushed in     remote: error: other way.     remote: error:      remote: error: squelch message , still keep default behaviour, set     remote: error: 'receive.denycurrentbranch' configuration variable 'refuse'.     error: failed push refs '/home/sdr1/desktop/localrepository' 

please read part of error message:

remote: error: default, updating current branch in non-bare repository remote: error: denied, because make index , work tree inconsistent remote: error: pushed, , require 'git reset --hard' match remote: error: work tree head. 

git prevents push branch of non-bare repository (here repo1), because make working tree, index , head inconsistent or error prone.

solution: switch original repository (repo1) different branch , try again push clone (repo2).


Comments