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_tmp
move new created branchbranch_tmp
git rebase master
apply last commits on top of mastergit checkout master
git merge branch_tmp
updatemaster
branch commits done , present onbranch_tmp
git push origin master
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
Post a Comment