Navigation Menu

Skip to content

Merging a dev branch shows lots of very old commits #22787

Discussion options

You must be logged in to vote

Well, it depends on whether you are okay with force-pushing and the associated issues or not. If not, you’ll have to merge and resolve any conflicts in favor of the dev branch.

If you are okay with force-pushing and losing everything that’s different from dev on the master branch, you can use git reset [<mode>] [<commit>]:

This form resets the current branch head to <commit> and possibly updates the index (resetting it to the tree of <commit>) and the working tree depending on <mode>.

So, you can do something like this:

git checkout master
git reset dev
git push --force origin master

Obligatory warning: If you do this, you will lose anything that’s only on the current master, and every…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants