github - Git checkout old commit, and further make new commits -


fyi: using bitbucket push git (i know not important).

i working on project, wherein made changes, , pushed origin master, realise master had major bug, hence checked out specific old commit, in same master branch using

git checkout commit_name

after started working further , kept adding , committing, lost how keep following new commits, not lose earlier (buggy) master. how on track.

p.s. tried using git push -u origin master , returns everything up-to-date, , nothing gets pushed bitbucket.

i guess on detached head. when did git checkout commit_name, updated local repository checkout code of commit_name not on branch. in freestyle way , can limited action. need go on master branch.

  1. git checkout -b branch_tmp move new created branch branch_tmp
  2. git rebase master apply last commits on top of master
  3. git checkout master
  4. git merge branch_tmp update master branch commits done , present on branch_tmp
  5. git push origin master
  6. git branch -d branch_tmp clean repository

in step, advice have log history understand different action performed.

you find more information detached head there


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -