P.S: Please note that i have read almost all other related questions about this but it still not working at all.
I have the following issue on master
branch:
On branch master
Your branch is ahead of 'origin/master' by 5 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
after reading most of the articles here about this case and asking the company i work for, i am not allowed to:
rebase
or use
git fetch origin git reset --hard origin/master
so i tried:
git fetch origin
git pull
but i have the same result after doing git status
What should i do to fix my local master
branch exactly?
not to push because i am on master
get rid of the current commit without affecting master
branch
To roll back 5 commits locally to keep in sync with remote master
branch, you can do this:
git reset --hard HEAD~5
Or run git log
and reset to the HEAD commit of origin/master
git reset --hard <commit id>
You could also just reset to origin/master
git reset --hard origin/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With