「Mercurial」の版間の差分
編集の要約なし |
→使用方法: 同期 |
||
| (3人の利用者による、間の7版が非表示) | |||
| 1行目: | 1行目: | ||
[[Category:バージョン管理システム]] |
[[Category:バージョン管理システム]] |
||
[[en:Mercurial]] |
[[en:Mercurial]] |
||
[http://mercurial.selenic.com/ Mercurial] (しばしば '''hg''' と呼称されます) は Python で書かれた分散型バージョン管理システムであり [[Git]], [http://bazaar.canonical.com/ Bazaar], [[ |
[http://mercurial.selenic.com/ Mercurial] (しばしば '''hg''' と呼称されます) は Python で書かれた分散型バージョン管理システムであり [[Git]], [http://bazaar.canonical.com/ Bazaar], [[Darcs]] と多くの点で似ているところがあります。 |
||
== インストール == |
== インストール == |
||
[[ |
{{Pkg|mercurial}} を[[インストール]]します、開発版の場合は、{{AUR|mercurial-hg}} をインストールしてください。 |
||
=== グラフィカルフロントエンド === |
|||
[https://www.mercurial-scm.org/wiki/OtherTools#Graphical_user_interfaces Mercurial グラフィカルユーザーインターフェイス] も参照してください。 |
|||
* {{App|hgk|リポジトリの履歴をグラフィカルに参照するための Tcl/Tk ベースのツール。|https://www.mercurial-scm.org/wiki/HgkExtension|{{Pkg|mercurial}} + {{Pkg|tk}}}} |
|||
* {{App|[[Wikipedia:TortoiseHg|TortoiseHg]]|Mercurial 分散リビジョン管理システム用のグラフィカルツールと Nautilus 拡張機能のセット。|https://tortoisehg.bitbucket.io/|{{AUR|tortoisehg}}}} |
|||
== 設定 == |
== 設定 == |
||
少なくともユーザー名は設定する必要があります。設定していないとコミットするときに mercurial はエラーを吐きます。{{ic|~/.hgrc}} を編集して以下を追加することでユーザー名を設定できます: |
少なくともユーザー名は設定する必要があります。設定していないとコミットするときに mercurial はエラーを吐きます。{{ic|~/.hgrc}} を編集して以下を追加することでユーザー名を設定できます: |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
username = John Smith <johnsmith@domain.tld>}} |
|||
| ⚫ | |||
You will need to install {{Pkg|tk}} before running '''hg view''' to avoid the rather cryptic error message: |
|||
| ⚫ | |||
| ⚫ | |||
To remove Mercurial warnings of unverified certificate fingerprints, add the following to {{ic|~/.hgrc}} (see [http://mercurial.selenic.com/wiki/CACertificates Mercurial wiki]): |
|||
{{hc|~/.hgrc|2=[web]<br/>cacerts = /etc/ssl/certs/ca-certificates.crt}} |
|||
| ⚫ | |||
If you are going to be working with large repositories (e.g. {{AUR|ttf-google-fonts-hg}}), you may want to enable the ''progress'' extension by adding it to your {{ic|~/.hgrc}} file: |
|||
hgk=}} |
|||
| ⚫ | |||
This will show progress bars on longer operations after 3 seconds. If you would like the progress bar to show sooner, you can append the following to your configuration file: |
|||
以下の難解なエラーメッセージを出ないようにするには {{ic|hg view}} を実行する前に {{Pkg|tk}} をインストールする必要があります: |
|||
| ⚫ | |||
| ⚫ | |||
== 使用方法 == |
== 使用方法 == |
||
mercurial のコマンドは全て ''hg'' から始まります。一般的なコマンドのリストを見るには、次を実行: |
mercurial のコマンドは全て ''hg'' から始まります。一般的なコマンドのリストを見るには、次を実行: |
||
{{bc|$ hg help}} |
{{bc|$ hg help}} |
||
各コマンドにはヘルプ ページがあり、次のコマンドを使用して読むことができます。 |
|||
You can either work with a pre-existing repository (collection of code or files), or create your own to share. |
|||
$ hg help ''subcommand'' |
|||
既存のリポジトリ (コードまたはファイルのコレクション) を操作することも、独自のリポジトリを作成して共有することもできます。 |
|||
To work with a pre-existing repository, you must clone it to a directory of your choice: |
|||
{{bc|$ mkdir mercurial<br/>$ cd mercurial<br/>$ hg clone http://hg.serpentine.com/tutorial/}} |
|||
既存のリポジトリを操作するには、選択したディレクトリにリポジトリのクローンを作成する必要があります: |
|||
To create you own, change to the directory you wish to share and initiate a mercurial project |
|||
| ⚫ | |||
$ mkdir mercurial |
|||
$ cd mercurial |
|||
$ hg clone https://repo.mercurial-scm.org/hello |
|||
自分でリポジトリを作成するにいは、共有したいディレクトリに移動して mercurial プロジェクトを開始します: |
|||
$ cd myfiles |
|||
| ⚫ | |||
=== ドットファイルリポジトリ === |
=== ドットファイルリポジトリ === |
||
If you intend on creating a repo of all your {{ic|~/.}} files, you simply initiate the project in your home folder: |
|||
{{ic|~/.}} ファイルのリポジトリを作成したいときは、ホームフォルダでプロジェクトを開始します: |
|||
{{bc|$ hg init}} |
{{bc|$ hg init}} |
||
追跡したい特定のファイルを追加するときは: |
|||
It is then just a case of adding the specific files you wish to track: |
|||
{{bc|$ hg add |file1 file2 file3}} |
{{bc|$ hg add |file1 file2 file3}} |
||
{{ic|~/.hgignore}} を作成することでリポジトリに含めたいファイルだけを mercurial によって追跡させることができます。 |
|||
You can then create a {{ic|~/.hgignore}} to ensure that only the files you wish to include in the repository are tracked by mercurial. |
|||
{{Tip|{{ic|.hgignore}} ファイルの一番上に {{ic|syntax: glob}} を追加することで、リポジトリから簡単にファイルを除外できるようになります。}} |
|||
{{Tip|If you include: syntax: glob at the top of the {{ic|.hgignore}} file, you can easily exclude groups of files from your repository.}} |
|||
== ヒントとテクニック == |
|||
=== プログレスバー === |
|||
大規模なリポジトリを操作する場合は、''progress'' 拡張子を {{ic|~/.hgrc}} ファイルに追加して有効にすることをお勧めします。 |
|||
| ⚫ | |||
progress =}} |
|||
これにより、3 秒を超える操作については進行状況バーが表示されます。進行状況バーをより早く表示したい場合は、設定ファイルに以下を追加できます。 |
|||
| ⚫ | |||
delay = 1.5}} |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
* [https://wiki.mercurial-scm.org/MercurialHosting Mercurial Hosting] - Mercurial ホスティングを提供するサービスのリスト Mercurial 公式 wiki より |
|||
| ⚫ | |||
* [http://bitbucket.org Bitbucket] - free and commercial hosting of mercurial repositories |
|||
* [http://mercurial.intuxication.org/ Intuxication] - free mercurial hosting |
|||
2024年3月5日 (火) 03:48時点における最新版
Mercurial (しばしば hg と呼称されます) は Python で書かれた分散型バージョン管理システムであり Git, Bazaar, Darcs と多くの点で似ているところがあります。
インストール
mercurial をインストールします、開発版の場合は、mercurial-hgAUR をインストールしてください。
グラフィカルフロントエンド
Mercurial グラフィカルユーザーインターフェイス も参照してください。
- hgk — リポジトリの履歴をグラフィカルに参照するための Tcl/Tk ベースのツール。
- TortoiseHg — Mercurial 分散リビジョン管理システム用のグラフィカルツールと Nautilus 拡張機能のセット。
設定
少なくともユーザー名は設定する必要があります。設定していないとコミットするときに mercurial はエラーを吐きます。~/.hgrc を編集して以下を追加することでユーザー名を設定できます:
~/.hgrc
[ui] username = John Smith <johnsmith@domain.tld>
グラフィカルブラウザ hgk 別名 hg view を使うには、以下を ~/.hgrc に追加してください (フォーラムスレッド を参照):
~/.hgrc
[extensions] hgk=
以下の難解なエラーメッセージを出ないようにするには hg view を実行する前に tk をインストールする必要があります:
/usr/bin/env: wish: No such file or directory
使用方法
mercurial のコマンドは全て hg から始まります。一般的なコマンドのリストを見るには、次を実行:
$ hg help
各コマンドにはヘルプ ページがあり、次のコマンドを使用して読むことができます。
$ hg help subcommand
既存のリポジトリ (コードまたはファイルのコレクション) を操作することも、独自のリポジトリを作成して共有することもできます。
既存のリポジトリを操作するには、選択したディレクトリにリポジトリのクローンを作成する必要があります:
$ mkdir mercurial $ cd mercurial $ hg clone https://repo.mercurial-scm.org/hello
自分でリポジトリを作成するにいは、共有したいディレクトリに移動して mercurial プロジェクトを開始します:
$ cd myfiles $ hg init myfiles
ドットファイルリポジトリ
~/. ファイルのリポジトリを作成したいときは、ホームフォルダでプロジェクトを開始します:
$ hg init
追跡したい特定のファイルを追加するときは:
$ hg add
~/.hgignore を作成することでリポジトリに含めたいファイルだけを mercurial によって追跡させることができます。
.hgignore ファイルの一番上に syntax: glob を追加することで、リポジトリから簡単にファイルを除外できるようになります。ヒントとテクニック
プログレスバー
大規模なリポジトリを操作する場合は、progress 拡張子を ~/.hgrc ファイルに追加して有効にすることをお勧めします。
~/.hgrc
[extensions] progress =
これにより、3 秒を超える操作については進行状況バーが表示されます。進行状況バーをより早く表示したい場合は、設定ファイルに以下を追加できます。
~/.hgrc
[progress] delay = 1.5
参照
- Mercurial: The Definitive Guide (日本語版)
- hginit.com - Joel Spolsky によるチュートリアル
- Mercurial Kick-Start - Aragost によるチュートリアル
- Mercurial Hosting - Mercurial ホスティングを提供するサービスのリスト Mercurial 公式 wiki より