3

I took over a project built with Cordova, Ionic and AngularJS to finally create a hybrid mobile app.

Source code is stored on bitbucket.org using Git; originally (before I took over) the code was downloaded from there.

On https://bitbucket.org v1.0 can be found; locally the code is v2.0.

Now I want to upload v2.0, but receive the message in IDE WebStorm 11.x: Can´t update: no current branch. You are in 'detached' state, which means that you're not on any branch. Checkout a branch to make update possible.

Note: Clicking the right little botton on the buttom showing versus origin/develop (which is the one on Bitbucket) and the on merge provides the message Already up-to-date, which is not true as files are(!) different.

git reflog says:

28ac44d HEAD@{0}: commit (merge): Merge remote-tracking branch 'origin/develop' into HEAD 338ffde HEAD@{1}: checkout: moving from develop to 338ffde8364f6bbf860d61b86eecbef8e84fe708 6399852 HEAD@{2}: commit (merge): Merge remote-tracking branch 'origin/develop' into develop 05e819c HEAD@{3}: merge remotes/origin/master: Merge made by the 'recursive' strategy. 338ffde HEAD@{4}: commit: Version 2.0.0 2c9fc80 HEAD@{5}: clone: from https://joey@bitbucket.org/abcdefgh/ijklmnop.git

What do I have to do now?

Joey
  • 511
  • 6
  • 20
  • This sounds very similar to: http://stackoverflow.com/questions/2498458/why-did-git-set-us-on-no-branch – WeekendDiver Jan 28 '16 at 22:15
  • Might be. However it is still not clear to me what do do now in order to avoid overwriting latest code... – Joey Jan 28 '16 at 22:30
  • You are, in your IDE, not on a (local) branch. You've merged `origin/develop` (which is not a *local* branch, it's a *remote-tracking* branch, which is not a branch, or at least, not the right kind of branch, because git people decided to use the word "branch" to mean multiple different things... [if at this point you want to go "arrgh" I fully agree with you :) ]). You need to create a (local) branch. I have no idea how to do that in your IDE, I only know how to use the command line. – torek Jan 28 '16 at 22:33
  • Thanks, torek, that helped. – Joey Jan 31 '16 at 19:45

0 Answers0