git - 使用 hggit 克隆 github repo - abort : repository not found

标签 git mercurial github clone hg-git

我正在尝试使用 hggit 在本地克隆一些 github 存储库。我正在关注 tutorial操作说明

$ hg clone git://github.com/schacon/hg-git.git
abort: repository git://github.com/schacon/hg-git.git not found!

$ hg clone git+ssh://git@github.com/schacon/hg-git.git
abort: repository git+ssh://git@github.com/schacon/hg-git.git not found!

我知道我有 hggit 因为下面的工作

$ python -c "import hggit"
$ head -n1 `which hg`
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python -c "import hggit"

此外,我还有另一个经常与 hg 一起使用的 github 存储库。我忘记了我最初是如何让它工作的,但我认为这是我 push github 的一个新的 repo 协议(protocol)。在我确实有工作 repo 的文件夹中,我的 .hg/hgrc 中有以下内容(为保护隐私而解释):

github = git+ssh://git@github.com:myname/repo.git

[ui]
username = Fname Lname <email@gmail.com>

[extensions]
hgext.bookmarks =
hggit =

当然,我只是想克隆的 repo 协议(protocol)没有 hgrc。

更新

$ hg help 给出类似的东西

Mercurial Distributed SCM

list of commands:

 add          add the specified files on the next commit
 addremove    add all new files, delete all missing files
 annotate     show changeset information by line for each file
 archive      create an unversioned archive of a repository revision
 backout      reverse effect of earlier changeset
 bisect       subdivision search of changesets
 branch       set or show the current branch name
 branches     list repository named branches
 bundle       create a changegroup file
 cat          output the current or given revision of files
 clone        make a copy of an existing repository
 commit       commit the specified files or all outstanding changes
 copy         mark files as copied for the next commit
 diff         diff repository (or selected files)
 export       dump the header and diffs for one or more changesets
 forget       forget the specified files on the next commit
 grep         search for a pattern in specified files and revisions
 heads        show current repository heads or show branch heads
 help         show help for a given topic or a help overview
 identify     identify the working copy or specified revision
 import       import an ordered set of patches
 incoming     show new changesets found in source
 init         create a new repository in the given directory
 locate       locate files matching specific patterns
 log          show revision history of entire repository or files
 manifest     output the current or given revision of the project manifest
 merge        merge working directory with another revision
 outgoing     show changesets not found in the destination
 parents      show the parents of the working directory or revision
 paths        show aliases for remote repositories
 pull         pull changes from the specified source
 push         push changes to the specified destination
 recover      roll back an interrupted transaction
 remove       remove the specified files on the next commit
 rename       rename files; equivalent of copy + remove
 resolve      redo merges or set/view the merge status of files
 revert       restore individual files or directories to an earlier state
 rollback     roll back the last transaction (dangerous)
 root         print the root (top) of the current working directory
 serve        start stand-alone webserver
 showconfig   show combined config settings from all hgrc files
 status       show changed files in the working directory
 summary      summarize working directory state
 tag          add one or more tags for the current or given revision
 tags         list repository tags
 tip          show the tip revision

 unbundle     apply one or more changegroup files
 update       update working directory (or switch revisions)
 verify       verify the integrity of the repository
 version      output version and copyright information

additional help topics:

 config       Configuration Files
 dates        Date Formats
 patterns     File Name Patterns
 environment  Environment Variables
 revisions    Specifying Single Revisions
 multirevs    Specifying Multiple Revisions
 revsets      Specifying Revision Sets
 diffs        Diff Formats
 merge-tools  Merge Tools
 templating   Template Usage
 urls         URL Paths
 extensions   Using additional features
 subrepos     Subrepositories
 hgweb        Configuring hgweb
 glossary     Glossary

use "hg -v help" to show aliases and global options

$ hg help extensions 给出类似的东西

Using additional features

    Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default
    behavior of commands, or implement hooks.

    Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide
    potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of
    stock Mercurial. It is thus up to the user to activate extensions as needed.

    To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your configuration file, like this:

      [extensions]
      foo =

    You may also specify the full path to an extension:

      [extensions]
      myfeature = ~/.hgext/myfeature.py

    To explicitly disable an extension enabled in a configuration file of broader scope, prepend its path with !:

      [extensions]
      # disabling extension bar residing in /path/to/extension/bar.py
      bar = !/path/to/extension/bar.py
      # ditto, but no path was supplied for extension baz
      baz = !

    disabled extensions:

     acl         hooks for controlling repository access
     bookmarks   track a line of development with movable markers
     bugzilla    hooks for integrating with the Bugzilla bug tracker
     children    command to display child changesets
     churn       command to display statistics about repository history
     color       colorize output from some commands
     convert     import revisions from foreign VCS repositories into Mercurial
     eol         automatically manage newlines in repository files
     extdiff     command to allow external programs to compare revisions
     fetch       pull, update and merge in one command
     gpg         commands to sign and verify changesets
     graphlog    command to view revision graphs from a shell
     hgcia       hooks for integrating with the CIA.vc notification service
     hgk         browse the repository in a graphical way
     highlight   syntax highlighting for hgweb (requires Pygments)
     interhg     expand expressions into changelog and summaries
     keyword     expand keywords in tracked files
     mq          manage a stack of patches
     notify      hooks for sending email notifications at commit/push time
     pager       browse command output with an external pager
     parentrevspec
                 interpret suffixes to refer to ancestor revisions
     patchbomb   command to send changesets as (a series of) patch emails
     progress    show progress bars for some actions
     purge       command to delete untracked files from the working directory
     rebase      command to move sets of revisions to a different ancestor
     record      commands to interactively select changes for commit/qrefresh
     relink      recreates hardlinks between repository clones
     schemes     extend schemes with shortcuts to repository swarms
     share       share a common history between several working directories
     transplant  command to transplant changesets from another branch
     win32mbcs   allow the use of MBCS paths with problematic encodings
     win32text   perform automatic newline conversion
     zeroconf    discover and advertise repositories on the local network

更新:修复 所以问题是我没有“$HOME/.hgrc”文件来使用扩展。添加此文件和扩展信息后,一切正常!

最佳答案

在基于 Debian 的 GNU/Linux 发行版上,除了

$ sudo apt install mercurial-git

我必须将以下行添加到我的 ~/.hgrc 文件中:

[extensions]
hggit = /usr/share/pyshared/hgext/git

关于git - 使用 hggit 克隆 github repo - abort : repository not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6432507/

相关文章:

Git 在 merge 时忽略已删除的文件

git - "branch is up-to-date with origin"但实际上不是

linux - 抑制或防止重复的 inotifywait 事件?

mercurial - 有没有办法让 Tortoisehg 存储库资源管理器从命令提示符启动?

git - 针对 pull 请求的 emacs 开发最多的 magit/github 扩展

git - 提交更改通过 "go get"安装的包的 pull 请求

git - 仅使用 HTTP 获取存储库当前 HEAD 的哈希值

php - 使用 Mercurial 进行开发和生产 php/MySQL 查询管理

svn - SVN 是否与 Mercurial 中的 "hg clone"或 Git 中的 "git clone"等效?

git - 反之亦然如何将HDFS中的文件获取/复制到Git存储库中?