Open cancan101 opened 9 years ago
:+1: for the possibility to use --force
on a git push
mapped command
You might be able to get away with something like
cd .hg
ln -s git .git
git push -f ...
cd .hg
ln -s git .git
git push -f <remote-clone-url>
@JasonGross thanks for the tip.
hg strip -r REV
followed by the above was exactly what I needed.
I'm thinking it's probably ok to leave the .git
symlink around.
Can anyone offer a reason why leaving it around might be a bad idea?
Bump
Unsure when it was added, but hg push -f
does work for this now.
@Psykar , which version do you use ? I use 0.8.5-2 from Ubuntu repository with Mercurial 3.7.3, and it's absent there.
@vlad1777d I'm on the current head with hg 4.2, so not particularly surprising I guess.
@Psykar, thanks
Strange, I downloaded last default branch from BitBucket 0.8.6 version,
try to make:
hg push -f git+ssh://git@github.com:vlad1777d/vlad1777d.github.io.git
,
but it returns:
pushing to git+ssh://git@github.com:vlad1777d/vlad1777d.github.io.git searching for changes abort: branch 'refs/heads/master' changed on the server, please pull and merge before pushing
Seems, commit, that allows force pushing, was made in 2009 year..
abderrahim | 51e4d6e | rework pushing to support --rev and --force options | 2009-07-31
What is the problem ?
I also just ran into this issue. Anything I could do to help?
I was not able to hg push --force
, I had to cd .hg/git
and git push --force
from there. A bit uncomfortable.
I am using hg-git to maintain a mirror of an hg repository but my git repos has some additional commits (my own). Whenever the hg repos has new commits, I want to pull those commits to git but then perform a rebase of my local commits to end of the hg history. That way I maintain the history from the upstream repos. Once the rebase is done, I need to force push to git.
What is the best way to do this with hg-git?