0

I cloned a repository via

git clone repoUrl

Next I wanted to roll back to a specific commit id via

git reset commitId

After reverting the local changes I have a clean master branch. When running

git status

it says

Your branch is behind 'origin/master' by 21 commits, and can be fast-forwarded.

Is it fine to make new local commits now? What will happen when I push the changes to the origin repo? Will it completely overwrite the master branch from the origin (I want that) or will it somehow try to merge the local master branch and the origin master branch.

I want to completely remove the most recent 21 commits and start new from an older commit.

1 Answers1

0

You won't have the right to rewrite the history of the branch in the remote repository unless you have the push force right. It's not advised unless you know exactly what you're doing (you can still revert all the 21 commits instead so that you can still see them in the history).

If you still want to proceed, you can look at the following link : How do I properly force a Git push?

st6ph
  • 76
  • 1
  • 5