Squashing Commits on Mercurial (Hg)

John Williams
1 min readApr 16, 2019

--

$ hg push -f // will create a branch with multiple heads

$ hg heads // will show if multiple heads

$ hg update -r <head-to-close:number>

$ hg commit — close-branch -m ‘Closing old branch’

$hg heads // check has been closed and hidden

$ hg update -r <head:number>

$ hg push

--

--