字幕表 動画を再生する
- Hi, I'm Matthew. - And I'm Brent.
- マシューです - ブレントです
And we're gonna talk to you about Git,
今日はGitについて話します
the version control system that
Gitはバージョン管理システムで―
brings the distributed nature
リポジトリが
of working with repositories
ローカルやウェブに分散する―
on your local machine, or on the web,
という性質をもち
to the lineage that is
CVSやSubversionなどの
CVS and Subversion.
仲間になります
[GitHub & Git Foundations] ♪ [music] ♪
[GitHub と Git の基礎] ♪[音楽]♪
[Introduction: Git]
[Git の紹介]
One of the things that I love so much about Git
Gitを愛してやまない点の1つは
is that everything I do is
作業のすべてがラップトップ上
local on my laptop
つまり明示的に指示しない限りは
until I tell it explicitly otherwise.
ローカルにあることです
So if I don't have any internet connection,
だからネット接続がなくても問題なし
no problem. I can get some work done,
いくらか仕事を進めたところで
and finally when I do get to that internet connection,
最後にネットにつながったら
I can send that data back to the remote server,
サーバにデータを送信して
and get some more work done.
また仕事が進むと
So, I can start with a repository
だから自分のマシンの
on my local machine,
リポジトリでスタートして
eventually, when I need to collaborate,
共同作業する必要が出てきたら
put it up on the web
ウェブに上げる
or some other hosted solution,
他のホスティングでもいいですけど
and this gives me the flexibility of both.
ローカルとネット上の いいとこ取りができる
Everything that I work on
やることは全て
can be under version control.
バージョン管理下におけます
But my question that I always start with is,
でも始めるときはいつも
"What tooling am I going to need?"
「どのツールが要るだろう?」と疑問に
The command line isn't the only option
Gitで使えるのは
for us to use when working with Git.
コマンドラインだけじゃないです
There's different graphical user interfaces
主要なOS上で動く
for all of the major operating systems.
GUIもあります
That means Windows, Mac, and Linux even,
つまりWindows Mac Linux
have their own graphical user interfaces
どれでもGUIツールがあります
but also come bundled with
もちろんコマンドラインの
command line tools to use.
ツールも使えます
If I think about, "How much will I need to learn
「生産性を上げるにはどれだけ覚えるの?」
to be productive with this?"
と思うかもしれません
Roughly ten commands and,
まあだいたいコマンド10個と
give or take, ten button clicks
ボタンのクリック10個前後
will be sufficient to allow you to use this
ふだんソフトウェア開発する分には
for your daily software development needs.
それで十分でしょう
[Introduction: GitHub Social Coding] ♪ [music] ♪
[GitHubソーシャルコーディングの紹介] ♪ [音楽] ♪
So Brent, we talked a little bit about
ブレント ここまでGitの基礎とか
the foundations of Git,
コマンドツールとかGUIとか
the tool, the command line, GUIs,
ローカルのデータベースで始めるとか
how it starts off with a local database
ウェブにpushするとか
and then can be pushed to the web,
話してきたけど
but what I'm interested in is
ちょっと聞いてみたいのは
when I'm starting a software project,
ソフトウェアプロジェクトを始める時に
why would I want to create the repository locally
どうしてリポジトリをローカルで立ちあげたいか
and how does Git call that
Gitがどうして分散型バージョン管理と呼ばれるか
distributed version control?
教えてくれる?
So the idea of creating this locally
ローカルで立ち上げるっていうのは
allows us to just start a project from fresh,
プロジェクトをまっさらの状態から
right there on our command line,
コマンドラインまたはGUIで
or with one of the graphical user interfaces,
その場で立ち上げられると
we can just say git init new project
git init 新規プロジェクト とやれば
and that'll create a folder
自分のファイルシステムに
right there in our file system
"New Project"という名前の
called New Project,
フォルダが作られて
and if we went ahead and moved into
もっと先に進めて ディレクトリ構造の
this directory structure,
中に入っていけば
we'd see that it contains just a simple .git folder,
中に .git フォルダがあって
which is really all that we need
それだけあればいいんです
to do any amount of our work.
どんな作業量であっても
We can then dive a little bit deeper
さらに .git フォルダを
into this .git folder
深く掘っていくと
to see some of the internals,
内部の詳細が見えてきて
and really get an idea for how Git
Gitがこれらのオブジェクトを
is persisting some of these objects as well.
どう扱ってるのか分かるようになってきます
So the .git folder is just that,
.gitフォルダはこのように1つのフォルダと
a folder, with some simple files.
いくつか単純なファイルからなります
And these are mostly plain text,
ほとんどはテキストファイルで
this is where everything gets saved
ソースコードとプロジェクトの
as we make historical evolutions
進化が 時系列で
to our source code and the project,
保存されていきます
and the nice part about this .git folder
.gitフォルダのいいところは
is that every one of the Git and GitHub tools
GitとGitHubのツールすべてが
writes to it.
そこに書き込んでいく点です
Whether it's GUI or command-line,
GUIでもコマンドラインでも
it simply writes to the .git folder.
シンプルに.gitに書き込みます
Close the laptop, put it to sleep,
パソコンを閉じて スリープにしても
it's all persisted.
すべて残っています
Now what about when I start to want to
じゃあリモートの保存先を
add remote destination?
追加したい場合は?
When I want to collaborate
誰か他の人と
with somebody else?
協同作業したいとか
We've been talking about saving it locally,
ここまでローカルに保存すると
having it persisted locally,
ローカルにずっと残るという話をしましたが
but what about getting it to someone else
誰か他の人にソースを渡して
and working with them on source code?
共同作業するにはどうすればいいんでしょう?
So when you want to interact
どこかリモートサイトと
with a different remote,
共同作業したい場合には
whether that be GitHub.com,
それがGitHub.comでも
or even your own friend's laptop,
友達のノートPCでも
you could set that up by
configファイル内に
creating a different address
違うアドレスを
inside your config file.
セットすることができます
This is just another place for Git
これはGitで別の場所から
to begin reading from,
データを読んできて
to understand where it's sending data to,
どこに送るかを解釈し
but also where it can pull data from.
またデータをpullできるところでもあります
So this idea is simply, again,
繰り返しますが アイデアは単純で
just reading into the text file,
テキストファイルを読んで
and letting Git know
Gitに対して
there is this address out there
このアドレスから情報を
that I want you to get information from,
取ってきたいと知らせて
and possibly send information to,
できればここに情報を送りたいと
but again, only when you specify.
繰り返しますが指定した場合だけです
So we set up this address,
なのでこのアドレスを用意して
it can be inside your network,
自前でホストがあるなら
if you have a self-hosted solution,
内部のネットワークにしてもいいです
it can be on the web, if you're using GitHub.com,
GitHub.comを使うならウェブでもいいです
the tools know how to speak with this,
ツールはどちらともやりとりできますし
and your primary work
主要な作業は依然 全部が
still happens on the laptop,
ノートPC上で ローカルで
locally, not with network access,
ネット接続なしで起こっていて
but then occasionally
ときどき 他の人たちと
as you need to collaborate with others
共同作業とか コードを共有することが
and share that code with them,
必要なときには
you use these two commands I heard you say,
2つのコマンドを使います
- Push and Pull. - Yep, that's right.
- Push と Pull - そのとおり
[Thanks for watching.] ♪ [music] ♪
[ご視聴ありがとうございました] ♪[音楽]♪
Thanks for watching this introduction to Git.
Gitのイントロダクションをご覧いただき ありがとうございました
As always, don't forget to subscribe
いつものように GitHub Guides の
to GitHub Guides,
購読もお忘れなく
and check out all of the other
GitHubからの他の動画も
amazing videos from GitHub.
ご覧ください
Feel free to ask comments and
コメントやご質問があれば
questions down below,
以下にご自由に残してください
we'll try to address those
今後の動画でご返答できればと
in an upcoming video,
思います
and if you like these training materials,
この教材がお気に入りでしたら
check out these guys, right down here.
こちらから 2人も見てみてください
♪ [music] ♪
♪[音楽]♪