I just installed Hg-Git and I was wondering if it is possible to push to both Bitbucket.org and Github.com from the same repository. I'm thinking of something like:
$ #make commits
$ hg push #pushes to Bitbucket since it is set as `default` in hgrc
$ hg push "github remote alias" #push to Github
So, by default it pushes to Bitbucket, and to push to Github by specifying a "remote" alias.
To push to a Git repository At the command line, make sure you've changed into the repository directory. Enter git push at the command line to push your commits from your local repository to Bitbucket. To be specific about exactly where you're pushing, enter git push <remote_server> <branch_name>.
When creating a new repository in BitBucket, click the button Import repository at the top right. Enter the https url found when clicking Clone or download in Github for the repository you want to fork. Give your repository a name, configure your privacy settings, and there you go!
If server detects a conflict when someone pushes data (and if two users are doing this "simultaneously" one of the pushes will be conflicting, because it will be applied only after the other one completes), the server will reject it, and the unlucky user shall then resolve conflicts and try to push again.
If your question is how to make hg push
able to push to multiple remote destinations, one by default and one named, then that's easy.
You edit the .hg\hgrc
file in your repository and add/modify:
[paths]
default = https://hg01.codeplex.com/mercurialnet
kiln = https://lassevk.kilnhg.com/Repo/Mercurial-Net/dev/trunk/
The above is my setting for one of my projects. By default, ie. just hg push
it pushes to CodePlex, but I can also ask it to push to kiln by executing hg push kiln
.
The one named default
is basically the one used if you don't specify the alias for a remote destinations, and you can have 0 or more named ones in addition to default
.
If that was not your question, please elaborate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With