Tutorial

NAME

gittutorial - A tutorial introduction to Gitgittutorial - Gitのチュートリアル紹介

SYNOPSIS概要

git *

DESCRIPTION説明

This tutorial explains how to import a new project into Git, make changes to it, and share changes with other developers.このチュートリアルでは、新しいプロジェクトをGitにインポートし、それに変更を加え、そして他の開発者と変更を共有する方法を説明します。

If you are instead primarily interested in using Git to fetch a project, for example, to test the latest version, you may prefer to start with the first two chapters of The Git User’s Manual.例えば、最新バージョンをテストするためにGitを使用してプロジェクトを取得することに主に関心がある場合は、The Git User's Manualの最初の2章から始めることをお勧めします。

First, note that you can get documentation for a command such as git log --graph with:まず、以下のようにコマンドのドキュメントを入手できることに注意してくださいgit log --graph

$ man git-log

or:または

$ git help log

With the latter, you can use the manual viewer of your choice; see git-help[1] for more information.後者では、あなたはあなたが選んだ手動ビューアを使うことができます。詳しくはgit-help [1]を参照してください。

It is a good idea to introduce yourself to Git with your name and public email address before doing any operation. The easiest way to do so is:何らかの操作を行う前に、自分の名前と一般の電子メールアドレスを使ってGitを紹介することをお勧めします。最も簡単な方法は次のとおりです。

$ git config --global user.name "Your Name Comes Here"
$ git config --global user.email you@yourdomain.example.com

Importing a new project新しいプロジェクトをインポートする

Assume you have a tarball project.tar.gz with your initial work. You can place it under Git revision control as follows.あなたの最初の仕事でtarball project.tar.gzがあるとしましょう。以下のようにGitリビジョン管理下に置くことができます。

$ tar xzf project.tar.gz
$ cd project
$ git init

Git will replyGitが返信します

Initialized empty Git repository in .git/

You’ve now initialized the working directory—​you may notice a new directory created, named ".git".これで作業ディレクトリが初期化されました。新しいディレクトリが作成されたことに気付くでしょう。名前は ".git"です。

Next, tell Git to take a snapshot of the contents of all files under the current directory (note the .), with git add:次に、(注意してカレントディレクトリ下のすべてのファイルの内容のスナップショットを取るためにGitリポジトリを伝えるで、)gitの追加

$ git add .

This snapshot is now stored in a temporary staging area which Git calls the "index". You can permanently store the contents of the index in the repository with git commit:このスナップショットは、Gitが "インデックス"と呼ぶ一時的なステージング領域に保存されています。git commitを使って、インデックスの内容をリポジトリに恒久的に保存することができます。

$ git commit

This will prompt you for a commit message. You’ve now stored the first version of your project in Git.これにより、コミットメッセージが表示されます。プロジェクトの最初のバージョンがGitに保存されました。

Making changes変更を加える

Modify some files, then add their updated contents to the index:いくつかのファイルを修正し、それらの更新内容をインデックスに追加します。

$ git add file1 file2 file3

You are now ready to commit. You can see what is about to be committed using git diff with the --cached option:これでコミットする準備が整いました。--cachedオプションを付けてgit diffを実行すると、コミットされようとしているものがわかります。

$ git diff --cached

(Without --cached, git diff will show you any changes that you’ve made but not yet added to the index.) You can also get a brief summary of the situation with git status:(--cachedを指定しないと、git diffは自分が行ったがまだインデックスに追加されていない変更をすべて表示します。)また、git statusを使って状況の簡単な要約を得ることもできます

$ git status
On branch master
Changes to be committed:
Your branch is up to date with 'origin/master'.
  (use "git reset HEAD <file>..." to unstage)
	modified:   file1
	modified:   file2
	modified:   file3

If you need to make any further adjustments, do so now, and then add any newly modified content to the index. Finally, commit your changes with:さらに調整が必要な場合は、ここで調整してから、新しく変更したコンテンツをインデックスに追加します。最後に、変更をコミットします。

$ git commit

This will again prompt you for a message describing the change, and then record a new version of the project.これにより、変更を説明するメッセージが表示され、新しいバージョンのプロジェクトが記録されます。

Alternatively, instead of running git add beforehand, you can useあるいは、事前にgit addを実行する代わりに、

$ git commit -a

which will automatically notice any modified (but not new) files, add them to the index, and commit, all in one step.これは自動的に変更された(しかし新しいではない)ファイルに気付き、それらをインデックスに追加し、そしてコミットします。

A note on commit messages: Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git. For example, git-format-patch[1] turns a commit into email, and it uses the title on the Subject line and the rest of the commit in the body.コミットメッセージに関するメモ:必須ではありませんが、コミットメッセージを変更を要約した短い(50文字未満)1行で始め、その後に空白行を1つ追加してから、より詳細な説明を続けることをお勧めします。コミットメッセージの最初の空白行までのテキストはコミットタイトルとして扱われ、そのタイトルはGitを通して使われます。たとえば、git-format-patch [1]はコミットを電子メールに変換し、Subject行のタイトルと本文の残りのコミットを使用します。

Git tracks content not filesGitはファイルではなくコンテンツを追跡します

Many revision control systems provide an add command that tells the system to start tracking changes to a new file. Git’s add command does something simpler and more powerful: git add is used both for new and newly modified files, and in both cases it takes a snapshot of the given files and stages that content in the index, ready for inclusion in the next commit.多くのリビジョン管理システムは、add新しいファイルへの変更の追跡を開始するようにシステムに指示するコマンドを提供します。Gitのaddコマンドは、より簡単で強力なものを提供します。git addは、新規ファイルと新規変更ファイルの両方に使用されます。どちらの場合も、指定されたファイルのスナップショットを取ります。

Viewing project historyプロジェクト履歴の表示

At any point you can view the history of your changes usingいつでもあなたはあなたの変更履歴を見ることができます。

$ git log

If you also want to see complete diffs at each step, use各ステップで完全な差分も見たい場合は、

$ git log -p

Often the overview of the change is useful to get a feel of each step多くの場合、変更の概要は各ステップを理解するのに役立ちます。

$ git log --stat --summary

Managing branchesブランチを管理する

A single Git repository can maintain multiple branches of development. To create a new branch named "experimental", use単一のGitリポジトリで複数の開発ブランチを管理できます。"experimental"という名前の新しいブランチを作成するには、

$ git branch experimental

If you now run今走ったら

$ git branch

you’ll get a list of all existing branches:既存のブランチすべてのリストが得られます。

  experimental
* master

The "experimental" branch is the one you just created, and the "master" branch is a default branch that was created for you automatically. The asterisk marks the branch you are currently on; type"実験的な"ブランチはあなたが今作成したもので、 "マスター"ブランチはあなたのために自動的に作られたデフォルトのブランチです。アスタリスクはあなたが現在いるブランチを示します。タイプ

$ git checkout experimental

to switch to the experimental branch. Now edit a file, commit the change, and switch back to the master branch:実験的ブランチに切り替えます。それでは、ファイルを編集し、変更をコミットしてから、masterブランチに戻ってください。

(edit file)
$ git commit -a
$ git checkout master

Check that the change you made is no longer visible, since it was made on the experimental branch and you’re back on the master branch.実験的なブランチで行ったもので、マスターブランチに戻ってきたので、行った変更が表示されなくなったことを確認します。

You can make a different change on the master branch:マスターブランチでは、別の変更を加えることができます。

(edit file)
$ git commit -a

at this point the two branches have diverged, with different changes made in each. To merge the changes made in experimental into master, runこの時点で2つのブランチは分岐し、それぞれに異なる変更が加えられています。実験的に行われた変更をmasterにマージするには、次のコマンドを実行します。

$ git merge experimental

If the changes don’t conflict, you’re done. If there are conflicts, markers will be left in the problematic files showing the conflict;変更が矛盾しなければ、完了です。競合がある場合は、競合を示す問題のあるファイルにマーカーが残ります。

$ git diff

will show this. Once you’ve edited the files to resolve the conflicts,これを表示します。競合を解決するためにファイルを編集したら、

$ git commit -a

will commit the result of the merge. Finally,マージの結果をコミットします。最後に、

$ gitk

will show a nice graphical representation of the resulting history.結果の履歴をわかりやすくグラフィカルに表示します。

At this point you could delete the experimental branch withこの時点で、実験的ブランチを削除することができます。

$ git branch -d experimental

This command ensures that the changes in the experimental branch are already in the current branch.このコマンドは、実験的ブランチの変更がすでに現在のブランチにあることを確認します。

If you develop on a branch crazy-idea, then regret it, you can always delete the branch withブランチのクレイジーなアイデアに基づいて開発した場合は、後悔して、いつでもブランチを削除できます。

$ git branch -D crazy-idea

Branches are cheap and easy, so this is a good way to try something out.枝は安くて簡単なので、これは何かを試すのに良い方法です。

Using Git for collaboration共同作業にGitを使用する

Suppose that Alice has started a new project with a Git repository in /home/alice/project, and that Bob, who has a home directory on the same machine, wants to contribute.Aliceが/ home / alice / projectにGitリポジトリを持つ新しいプロジェクトを始め、同じマシンにホームディレクトリを持つBobが貢献したいとします。

Bob begins with:ボブは以下から始まります。

bob$ git clone /home/alice/project myrepo

This creates a new directory "myrepo" containing a clone of Alice’s repository. The clone is on an equal footing with the original project, possessing its own copy of the original project’s history.これにより、Aliceのリポジトリのクローンを含む新しいディレクトリ "myrepo"が作成されます。クローンはオリジナルのプロジェクトの歴史のコピーを所有しており、オリジナルのプロジェクトと同じ立場にあります。

Bob then makes some changes and commits them:次にボブはいくつかの変更を加えてコミットします。

(edit files)
bob$ git commit -a
(repeat as necessary)

When he’s ready, he tells Alice to pull changes from the repository at /home/bob/myrepo. She does this with:準備ができたら、彼はAliceに/ home / bob / myrepoのリポジトリから変更を取り込むように指示します。彼女はこれをします。

alice$ cd /home/alice/project
alice$ git pull /home/bob/myrepo master

This merges the changes from Bob’s "master" branch into Alice’s current branch. If Alice has made her own changes in the meantime, then she may need to manually fix any conflicts.これはBobの "master"ブランチからAliceの現在のブランチへの変更をマージします。その間にアリスが自分で変更を加えた場合は、競合を手動で修正する必要があります。

The "pull" command thus performs two operations: it fetches changes from a remote branch, then merges them into the current branch.そのため、 "pull"コマンドは2つの操作を実行します。それは、リモートブランチから変更を取得し、それからそれらを現在のブランチにマージします。

Note that in general, Alice would want her local changes committed before initiating this "pull". If Bob’s work conflicts with what Alice did since their histories forked, Alice will use her working tree and the index to resolve conflicts, and existing local changes will interfere with the conflict resolution process (Git will still perform the fetch but will refuse to merge --- Alice will have to get rid of her local changes in some way and pull again when this happens).一般に、アリスはこの「プル」を開始する前に彼女のローカルな変更をコミットして欲しいと思うでしょう。Bobの作業がアリスがその歴史を分岐させてから行った作業と矛盾する場合、アリスは作業ツリーとインデックスを使用して矛盾を解決し、既存のローカル変更は矛盾解決プロセスを妨げます(Gitはまだフェッチを実行しますがマージを拒否します - ) - アリスは何らかの方法で彼女のローカルな変更を取り除き、これが起こったときにもう一度引っ張らなければならないでしょう)。

Alice can peek at what Bob did without merging first, using the "fetch" command; this allows Alice to inspect what Bob did, using a special symbol "FETCH_HEAD", in order to determine if he has anything worth pulling, like this:Aliceは、 "fetch"コマンドを使用して、最初にマージせずにBobがしたことを覗くことができます。これにより、Aliceは特別なシンボル "FETCH_HEAD"を使用して、Bobが何をしたのかを調べることができます。

alice$ git fetch /home/bob/myrepo master
alice$ git log -p HEAD..FETCH_HEAD

This operation is safe even if Alice has uncommitted local changes. The range notation "HEAD..FETCH_HEAD" means "show everything that is reachable from the FETCH_HEAD but exclude anything that is reachable from HEAD". Alice already knows everything that leads to her current state (HEAD), and reviews what Bob has in his state (FETCH_HEAD) that she has not seen with this command.Aliceが未確定のローカル変更を行っていても、この操作は安全です。範囲表記「HEAD..FETCH_HEAD」は、「FETCH_HEADから到達可能なものはすべて表示しますが、HEADから到達可能なものはすべて除外します」という意味です。アリスはすでに自分の現在の状態(HEAD)に至るすべてのことを知っていて、このコマンドで見ていないボブが自分の状態(FETCH_HEAD)に持っているものをレビューします。

If Alice wants to visualize what Bob did since their histories forked she can issue the following command:アリスが彼らの歴史が分岐してからボブがしたことを視覚化したいならば、彼女は以下のコマンドを出すことができます:

$ gitk HEAD..FETCH_HEAD

This uses the same two-dot range notation we saw earlier with git log.これはgit logで以前に見たのと同じ2ドット範囲表記を使います

Alice may want to view what both of them did since they forked. She can use three-dot form instead of the two-dot form:アリスは二人がフォークしてから彼らの両方がしたことを見たいと思うかもしれません。彼女は2ドット形式の代わりに3ドット形式を使うことができます。

$ gitk HEAD...FETCH_HEAD

This means "show everything that is reachable from either one, but exclude anything that is reachable from both of them".つまり、「どちらか一方から到達可能なものはすべて表示しますが、両方から到達可能なものはすべて除外します」という意味です。

Please note that these range notation can be used with both gitk and "git log".これらの範囲表記はgitkと "git log"の両方で使用できることに注意してください。

After inspecting what Bob did, if there is nothing urgent, Alice may decide to continue working without pulling from Bob. If Bob’s history does have something Alice would immediately need, Alice may choose to stash her work-in-progress first, do a "pull", and then finally unstash her work-in-progress on top of the resulting history.ボブが何をしたかを調べた後、緊急のことが何もなければ、アリスはボブから引っ張らずに働き続けることを決定するかもしれません。ボブの歴史がアリスがすぐに必要とするものを持っているならば、アリスは最初に彼女の進行中の仕事を隠しておくことを選ぶかもしれません、そして、結果の歴史の上に最終的に彼女の進行中の仕事を隠します。

When you are working in a small closely knit group, it is not unusual to interact with the same repository over and over again. By defining remote repository shorthand, you can make it easier:あなたが小さな密接に結びついたグループで作業しているとき、それは何度も何度も同じリポジトリと対話することは珍しくありません。リモートリポジトリを簡単に定義することで、簡単にすることができます。

alice$ git remote add bob /home/bob/myrepo

With this, Alice can perform the first part of the "pull" operation alone using the git fetch command without merging them with her own branch, using:これにより、Aliceはgit fetchコマンドを使用して、「pull」操作の最初の部分を自分のブランチとマージせずに単独で実行できます。

alice$ git fetch bob

Unlike the longhand form, when Alice fetches from Bob using a remote repository shorthand set up with git remote, what was fetched is stored in a remote-tracking branch, in this case bob/master. So after this:速記形式とは異なり、Aliceがgit remoteで設定されたリモートリポジトリを使用してBobから取得すると、取得されたものがこの場合はリモート追跡ブランチに格納されますbob/master。だからこの後:

alice$ git log -p master..bob/master

shows a list of all the changes that Bob made since he branched from Alice’s master branch.BobがAliceのマスターブランチから分岐してから行ったすべての変更のリストを表示します。

After examining those changes, Alice could merge the changes into her master branch:それらの変更を調べた後、Aliceは変更を彼女のマスターブランチにマージすることができます。

alice$ git merge bob/master

This merge can also be done by pulling from her own remote-tracking branch, like this:これmergeは、次のように自分のリモートトラッキングブランチから引っ張っても実行できます。

alice$ git pull . remotes/bob/master

Note that git pull always merges into the current branch, regardless of what else is given on the command line.git pullは、コマンドラインで他に何が与えられたとしても、常に現在のブランチにマージされることに注意してください。

Later, Bob can update his repo with Alice’s latest changes using後に、BobはAliceの最新の変更でレポジトリを更新することができます。

bob$ git pull

Note that he doesn’t need to give the path to Alice’s repository; when Bob cloned Alice’s repository, Git stored the location of her repository in the repository configuration, and that location is used for pulls:彼はAliceのリポジトリへのパスを与える必要はないことに注意してください。BobがAliceのレポジトリを複製したとき、Gitは自分のレポジトリの場所をレポジトリ設定に保存しました、そしてその場所はpullに使われます:

bob$ git config --get remote.origin.url
/home/alice/project

(The complete configuration created by git clone is visible using git config -l, and the git-config[1] man page explains the meaning of each option.)git cloneによって作成された完全な設定はを使って見ることができgit config -lgit-config [1]の manページは各オプションの意味を説明しています。)

Git also keeps a pristine copy of Alice’s master branch under the name "origin/master":Gitはまた、Aliceのマスターブランチの元のコピーを "origin / master"という名前で保存しています。

bob$ git branch -r
  origin/master

If Bob later decides to work from a different host, he can still perform clones and pulls using the ssh protocol:後で別のホストから作業することにした場合でも、ボブはsshプロトコルを使用してクローン作成とプルを実行できます。

bob$ git clone alice.org:/home/alice/project myrepo

Alternatively, Git has a native protocol, or can use http; see git-pull[1] for details.あるいは、Gitはネイティブプロトコルを持っているか、httpを使うことができます。詳細はgit-pull [1]をご覧ください。

Git can also be used in a CVS-like mode, with a central repository that various users push changes to; see git-push[1] and gitcvs-migration[7].GitはCVSのようなモードでも使用でき、さまざまなユーザが変更をプッシュする中央リポジトリがあります。git-push [1]gitcvs-migration [7]を参照してください。

Exploring history歴史を探る

Git history is represented as a series of interrelated commits. We have already seen that the git log command can list those commits. Note that first line of each git log entry also gives a name for the commit:Git履歴は一連の相互に関連したコミットとして表されます。git logコマンドがそれらのコミットをリストできることをすでに見ました。各gitログエントリの最初の行もコミットの名前を与えていることに注意してください。

$ git log
commit c82a22c39cbc32576f64f5c6b3f24b99ea8149c7
Author: Junio C Hamano <junkio@cox.net>
Date:   Tue May 16 17:18:22 2006 -0700
    merge-base: Clarify the comments on post processing.

We can give this name to git show to see the details about this commit.このコミットについての詳細を見るためにgit showにこの名前を付けることができます。

$ git show c82a22c39cbc32576f64f5c6b3f24b99ea8149c7

But there are other ways to refer to commits. You can use any initial part of the name that is long enough to uniquely identify the commit:しかし、コミットを参照する方法は他にもあります。コミットを一意に識別するのに十分な長さであれば、名前の最初の部分を使用できます。

$ git show c82a22c39c	# the first few characters of the name are
			# usually enough
$ git show HEAD		# the tip of the current branch
$ git show experimental	# the tip of the "experimental" branch

Every commit usually has one "parent" commit which points to the previous state of the project:各コミットは通常、プロジェクトの以前の状態を指す1つの「親」コミットを持ちます。

$ git show HEAD^  # to see the parent of HEAD
$ git show HEAD^^ # to see the grandparent of HEAD
$ git show HEAD~4 # to see the great-great grandparent of HEAD

Note that merge commits may have more than one parent:マージコミットは複数の親を持つことができることに注意してください。

$ git show HEAD^1 # show the first parent of HEAD (same as HEAD^)
$ git show HEAD^2 # show the second parent of HEAD

You can also give commits names of your own; after running自分のコミットの名前を付けることもできます。走った後

$ git tag v2.5 1b2e1d63ff

you can refer to 1b2e1d63ff by the name "v2.5". If you intend to share this name with other people (for example, to identify a release version), you should create a "tag" object, and perhaps sign it; see git-tag[1] for details.1b2e1d63ffは "v2.5"という名前で参照できます。もしあなたがこの名前を他の人々と共有するつもりなら(例えば、リリースバージョンを識別するために)、あなたは "tag"オブジェクトを作成し、そしておそらくそれに署名するべきです。詳細はgit-tag [1]を見てください。

Any Git command that needs to know a commit can take any of these names. For example:コミットを知る必要があるすべてのGitコマンドは、これらの名前のどれでも使用できます。例えば:

$ git diff v2.5 HEAD	 # compare the current HEAD to v2.5
$ git branch stable v2.5 # start a new branch named "stable" based
			 # at v2.5
$ git reset --hard HEAD^ # reset your current branch and working
			 # directory to its state at HEAD^

Be careful with that last command: in addition to losing any changes in the working directory, it will also remove all later commits from this branch. If this branch is the only branch containing those commits, they will be lost. Also, don’t use git reset on a publicly-visible branch that other developers pull from, as it will force needless merges on other developers to clean up the history. If you need to undo changes that you have pushed, use git revert instead.その最後のコマンドに注意してください:作業ディレクトリの変更を失うことに加えて、それはまたこのブランチから全ての後のコミットを削除するでしょう。このブランチがそれらのコミットを含む唯一のブランチである場合、それらは失われます。また、歴史をきれいにするために他の開発者に不必要なマージを強いるので、他の開発者が引っ張ってくる一般公開れているブランチにgit resetを使用しないでください。プッシュした変更を元に戻す必要がある場合は、代わりにgit revertを使用してください。

The git grep command can search for strings in any version of your project, sogit grepののコマンドは、そう、あなたのプロジェクトのいずれかのバージョンの文字列を検索することができます

$ git grep "hello" v2.5

searches for all occurrences of "hello" in v2.5.v2.5ですべての "hello"を探します。

If you leave out the commit name, git grep will search any of the files it manages in your current directory. Soコミット名を省略すると、git grepは現在のディレクトリで管理しているファイルを検索します。そう

$ git grep "hello"

is a quick way to search just the files that are tracked by Git.Gitによって追跡されているファイルだけを検索する簡単な方法です。

Many Git commands also take sets of commits, which can be specified in a number of ways. Here are some examples with git log:多くのGitコマンドもコミットのセットを取ります。コミットはさまざまな方法で指定できます。以下はgit logの例です。

$ git log v2.5..v2.6            # commits between v2.5 and v2.6
$ git log v2.5..                # commits since v2.5
$ git log --since="2 weeks ago" # commits from the last 2 weeks
$ git log v2.5.. Makefile       # commits since v2.5 which modify
				# Makefile

You can also give git log a "range" of commits where the first is not necessarily an ancestor of the second; for example, if the tips of the branches "stable" and "master" diverged from a common commit some time ago, thenまた、最初のコミットが2番目のコミットの祖先であるとは限らないコミットの「範囲」をgit logに与えることもできます。たとえば、「安定」ブランチと「マスター」ブランチのヒントが少し前に共通のコミットとは異なる場合、

$ git log stable..master

will list commits made in the master branch but not in the stable branch, whileマスターブランチでは行われたがステーブルブランチでは行われなかったコミットを一覧表示します。

$ git log master..stable

will show the list of commits made on the stable branch but not the master branch.stableブランチでは行われたがmasterブランチでは行われなかったコミットのリストを表示します。

The git log command has a weakness: it must present commits in a list. When the history has lines of development that diverged and then merged back together, the order in which git log presents those commits is meaningless.gitのログコマンドは弱点があります。それは、リスト内のコミットを提示しなければなりません。歴史の中に分岐してマージされた開発ラインがある場合、git logがそれらのコミットを表す順序は意味がありません。

Most projects with multiple contributors (such as the Linux kernel, or Git itself) have frequent merges, and gitk does a better job of visualizing their history. For example,複数の貢献者(LinuxカーネルやGit自体など)を含むほとんどのプロジェクトは頻繁にマージされ、gitkは彼らの歴史を視覚化するためのより良い仕事をします。例えば、

$ gitk --since="2 weeks ago" drivers/

allows you to browse any commits from the last 2 weeks of commits that modified files under the "drivers" directory. (Note: you can adjust gitk’s fonts by holding down the control key while pressing "-" or "+".)過去2週間の "drivers"ディレクトリ配下のファイルを変更したコミットのうち、任意のコミットを閲覧することができます。(注:コントロールキーを押しながら " - "または "+"を押すことでgitkのフォントを調整できます。)

Finally, most commands that take filenames will optionally allow you to precede any filename by a commit, to specify a particular version of the file:最後に、ファイル名を取るほとんどのコマンドでは、ファイルの特定のバージョンを指定するために、任意のファイル名の前にコミットを付けることができます。

$ git diff v2.5:Makefile HEAD:Makefile.in

You can also use git show to see any such file:git showを使ってそのようなファイルを見ることもできます。

$ git show v2.5:Makefile

Next Steps次のステップ

This tutorial should be enough to perform basic distributed revision control for your projects. However, to fully understand the depth and power of Git you need to understand two simple ideas on which it is based:このチュートリアルはあなたのプロジェクトの基本的な分散型リビジョン管理を実行するのに十分なはずです。しかし、Gitの深さと力を完全に理解するには、それが基づいている2つの簡単なアイデアを理解する必要があります。

  • The object database is the rather elegant system used to store the history of your project—​files, directories, and commits.オブジェクトデータベースは、プロジェクトの履歴(ファイル、ディレクトリ、コミット)を保存するために使用されるかなり洗練されたシステムです。

  • The index file is a cache of the state of a directory tree, used to create commits, check out working directories, and hold the various trees involved in a merge.インデックスファイルは、ディレクトリツリーの状態のキャッシュであり、コミットの作成、作業ディレクトリのチェックアウト、およびマージに関連するさまざまなツリーの保持に使用されます。

Part two of this tutorial explains the object database, the index file, and a few other odds and ends that you’ll need to make the most of Git. You can find it at gittutorial-2[7].このチュートリアルのパート2では、オブジェクトデータベース、インデックスファイル、およびGitを最大限に活用するために必要なその他のいくつかのオッズとエンドについて説明します。あなたはでそれを見つけることができgittutorial-2 [7]

If you don’t want to continue with that right away, a few other digressions that may be interesting at this point are:あなたがすぐにそれを続けたくないならば、この時点で興味深いかもしれない他のいくつかの余談があります:

  • git-format-patch[1], git-am[1]: These convert series of git commits into emailed patches, and vice versa, useful for projects such as the Linux kernel which rely heavily on emailed patches.git-format-patch [1]git-am [1]:これらの一連のgitコミットを電子メールのパッチに変換します。逆の場合も同様です。電子メールのパッチに大きく依存するLinuxカーネルなどのプロジェクトに役立ちます。

  • git-bisect[1]: When there is a regression in your project, one way to track down the bug is by searching through the history to find the exact commit that’s to blame. Git bisect can help you perform a binary search for that commit. It is smart enough to perform a close-to-optimal search even in the case of complex non-linear history with lots of merged branches.git-bisect [1]:プロジェクトに回帰がある場合、バグを突き止める1つの方法は、履歴を検索して、責任を負うべき正確なコミットを見つけることです。Git bisectは、そのコミットに対して二分探索を実行するのに役立ちます。たくさんのマージされたブランチがある複雑な非線形履歴の場合でも、最適に近い検索を実行するのに十分スマートです。

  • gitworkflows[7]: Gives an overview of recommended workflows.gitworkflows [7]:推奨されるワークフローの概要を説明しています。

  • giteveryday[7]: Everyday Git with 20 Commands Or So.giteveryday [7]:毎日20のコマンドでGit。

  • gitcvs-migration[7]: Git for CVS users.gitcvs-migration [7]:CVSユーザーのためのGit。

SEE ALSO関連項目

gittutorial-2[7], gitcvs-migration[7], gitcore-tutorial[7], gitglossary[7], git-help[1], gitworkflows[7], giteveryday[7], The Git User’s Manualgittutorial-2 [7]gitcvs-migration [7]gitcore-tutorial [7]gitglossary [7]git-help [1]gitworkflows [7]giteveryday [7]The Gitユーザーマニュアル

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

onResizeStart

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る