在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:schacon/hg-git开源软件地址:https://github.com/schacon/hg-git开源编程语言:Python 58.3%开源软件介绍:Hg-Git Mercurial Plugin
This is the Hg-Git plugin for Mercurial, adding the ability to push and pull to/from a Git server repository from Hg. This means you can collaborate on Git based projects from Hg, or use a Git server as a collaboration point for a team with developers using both Git and Hg. The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via an Hg repository and another Hg client can pull it and their changeset node ids will be identical - Mercurial data does not get lost in translation. It is intended that Hg users may wish to use this to collaborate even if no Git users are involved in the project, and it may even provide some advantages if you're using Bookmarks (see below). DependenciesThis plugin is implemented entirely in Python - there are no Git binary dependencies, you do not need to have Git installed on your system. The only dependencies are Mercurial and Dulwich. See the Makefile for information about which versions of Mercurial are known to work, and setup.py for which versions of Dulwich are required. UsageYou can clone a Git repository from Hg by running
Hg-Git would clone the repository and convert it to an Hg repository for you. If you want to clone a github repository for later pushing (or any other repository you access via ssh), you need to convert the ssh url to a format with an explicit protocol prefix. For example, the git url with push access
would read
(Mind the switch from colon to slash after the host!) Your clone command would thus look like this:
If you are starting from an existing Hg repository, you have to set up
a Git repository somewhere that you have push access to, add a path entry
for it in your .hg/hgrc file, and then run
This will convert all your Hg data into Git objects and push them to the Git server. Now that you have an Hg repository that can push/pull to/from a Git
repository, you can fetch updates with
That will pull down any commits that have been pushed to the server in the meantime and give you a new head that you can merge in. Hg-Git can also be used to convert a Mercurial repository to Git. You can use a local repository or a remote repository accessed via SSH, HTTP or HTTPS. Use the following commands to convert the repository (it assumes you're running this in $HOME).
The hg bookmark is necessary to prevent problems as otherwise hg-git pushes to the currently checked out branch confusing Git. This will create a branch named hg in the Git repository. To get the changes in master use the following command (only necessary in the first run, later just use git merge or rebase).
To import new changesets into the Git repository just rerun the hg push command and then use git merge or git rebase in your Git repository. CommandsgclearTODO gimportTODO gexportTODO git-cleanupTODO Hg Bookmarks IntegrationHg-Git pushes your bookmarks up to the Git server as branches and will pull Git branches down and set them up as bookmarks. InstallingClone this repository somewhere and make the 'extensions' section in
your
That will enable the Hg-Git extension for you. See the Makefile for a list of compatible Mercurial versions. Configurationgit.intreehg-git keeps a git repository clone for reading and updating. By default, the
git clone is the subdirectory
git.authorsGit uses a strict convention for "author names" when representing changesets,
using the form
Since these default behaviors may not be what you want (
Where
Empty lines and lines starting with a "#" are ignored. It should be noted that this translation is on the hg->git side only. Changesets coming from Git back to Mercurial will not translate back into hg usernames, so it's best that the same username/email combination be used on both the hg and git sides; the author file is mostly useful for translating legacy changesets. git.branch_bookmark_suffixhg-git does not convert between Mercurial named branches and git branches as
the two are conceptually different; instead, it uses Mercurial bookmarks to
represent the concept of a git branch. Therefore, when translating an hg repo
over to git, you typically need to create bookmarks to mirror all the named
branches that you'd like to see transferred over to git. The major caveat with
this is that you can't use the same name for your bookmark as that of the
named branch, and furthermore there's no feasible way to rename a branch in
Mercurial. For the use case where one would like to transfer an hg repo over
to git, and maintain the same named branches as are present on the hg side,
the
Above, if an hg repo had a named branch called The git.mindateIf set, branches where the latest commit's commit time is older than this will
not be imported. Accepts any date formats that Mercurial does -- see
git.similaritySpecify how similar files modified in a Git commit must be to be imported as Mercurial renames or copies, as a percentage between "0" (disabled) and "100" (files must be identical). For example, "90" means that a delete/add pair will be imported as a rename if more than 90% of the file has stayed the same. The default is "0" (disabled). git.renamelimitThe number of files to consider when performing the copy/rename detection.
Detection is disabled if the number of files modified in a commit is above the
limit. Detection is O(N^2) in the number of files modified, so be sure not to
set the limit too high. Similar to Git's git.findcopiesharderWhether to consider unmodified files as copy sources. This is a very expensive
operation for large projects, so use it with caution. Similar to |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论