2

I have situation like I need to hard reset from one branch to another.I have explained the scenario over here.How to hard reset from one git branch to other in JGit? It is working like a charm for git project.I need it for gerrit projects also.If I do the same and push it htrough gerrit

 git push http://obulis@192.168.15.19:8088/obuli/project1 HEAD:refs/for/master

I am getting error like this:

 Total 0 (delta 0), reused 0 (delta 0)
 remote: Processing changes: refs: 1, done
 To http://obulis@192.168.15.19:8088/obuli/project1
 ! [remote rejected] HEAD -> refs/for/master (no new changes)
 error: failed to push some refs to 
 http://obulis@192.168.215.19:8088/obuli/project1'

Any idea ?

Community
  • 1
  • 1
Obuli Sundar
  • 566
  • 7
  • 26
  • Did you commit anything? What exactly are you trying to push? – Tim Sep 28 '15 at 13:17
  • @TimCastelijns: Actually I have two branches master and level1. level 1 is the latest which contains lot of commits.I need to hard reset the master to level1. so that master and level1 will be same.It works upto that.But while pushing i am getting this error.But it is not occurring for git projects. – Obuli Sundar Sep 28 '15 at 13:22
  • What you describe sounds more like you want to merge master into level1, can you confirm that? Do you have those 2 branches both local and on gerrit? – Tim Sep 28 '15 at 13:23
  • @TimCastelijns It is more like overwriting master with leve1.I need history so i am going for hard reset option as i explained here http://stackoverflow.com/questions/32736517/how-to-hard-reset-from-one-git-branch-to-other-in-jgit .yes i have both the branches on local and gerrit – Obuli Sundar Sep 28 '15 at 13:32

0 Answers0