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.
git checkout -b branch_tmpmove new created branchbranch_tmpgit rebase masterapply last commits on top of mastergit checkout mastergit merge branch_tmpupdatemasterbranch commits done , present onbranch_tmpgit push origin mastergit branch -d branch_tmpclean repository
in step, advice have log history understand different action performed.
you find more information detached head there
Comments
Post a Comment