hg-git tutorial? [was Re: Bookmarks with hg update question]
Arne Babenhauserheide
arne_bab at web.de
Tue Jun 28 20:46:09 UTC 2016
Ethan Furman writes:
> On 06/28/2016 10:22 AM, Bryan Murdock wrote:
> Is there a good tutorial on that somewhere? I'm going to have to start
> interfacing with git repositories and I'm not looking forward to it.
I donât know any, but when contributing to Freenet on GitHub I just
follow this approach:
- clone a repo.
- for simple changes, just commit there. Use graft to reorder
commits. Change history at will. In the end set the bookmark where I
want it and push -f -r <bookmark>. Then file a pull-request. For
pull-requests rewriting the history git people see works easily. On
the hg side itâs just a label, but for git people moving a bookmark
looks like rewritten history.
- For complex or longterm work, create a bridge repo. Then clone a
work-repo from that. In the work repo I have a file pull-u and a file
push which simply coordinate pulling and pushing via an intermediate
repository. This frees me from having to take care of breakages in the
hg-git interfacing: rollback, amend, mutable history and so forth just
work.
pull-u
```
#!/bin/sh
hg -R ~/fred-staging pull ; hg pull -u
```
push
```
#!/bin/sh
for i in $(hg id -B); do hg push -B $i; hg -R ~/fred-staging push -r $i -f; done
```
Best wishes,
Arne
--
Unpolitisch sein
heiÃt politisch sein
ohne es zu merken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20160628/fe46ea9f/attachment.sig>
More information about the Mercurial
mailing list