これは、ユーザーが2025-4-30 17:05にhttps://app.immersivetranslate.com/pdf-pro/e60e2b98-932b-40db-ba7a-becee2503bdf/?isTrial=trueのために保存したバイリンガルスナップショットページで、イマーシブ翻訳によって提供されたバイリンガルサポートがあります。保存方法を学ぶ?

GitHub Git Cheat Sheet
GitHub Git チートシート

Git is the open source distributed version control system that facilitates GitHub activities on your laptop or desktop. This cheat sheet summarizes commonly used Git command line instructions for quick reference.
Gitは、あなたのラップトップやデスクトップでのGitHub 活動を促進するオープンソースの分散バージョン管理システムです。このチートシートは、迅速な参照のために一般的に使用されるGitコマンドライン命令を要約しています。

Install  インストール

GitHub for Windows

GitHub for Mac  Mac 用 GitHub

Git for All Platforms
すべてのプラットフォーム用 Git

http://git-scm.com
Git distributions for Linux and POSIX systems are available on the official Git SCM web site.
LinuxおよびPOSIXシステム用のGitディストリビューションは、公式のGit SCMウェブサイトで入手できます。

Configure tooling  ツールの設定

Configure user information for all local repositories
すべてのローカルリポジトリのユーザー情報を設定する
$ git config --global user.name "[name]"
Sets the name you want attached to your commit transactions
$ git config --global user.email "[email address]"
Sets the email you want attached to your commit transactions
$ git config --global color.ui auto
Enables helpful colorization of command line output

Branches  ブランチ

Branches are an important part of working with Git. Any commits you make will be made on the branch you’re currently “checked out” to. Use git status to see which branch that is.
ブランチは、Gitを使用する上で重要な部分です。行ったすべてのコミットは、現在「チェックアウト」しているブランチに対して行われます。どのブランチにいるかを確認するには、git statusを使用してください。
$ git branch [branch-name]
    Creates a new branch
$ git checkout [branch-name]
    Switches to the specified branch and updates the
    working directory
$ git merge [branch]
    Combines the specified branch's history into the
    current branch. This is usually done in pull requests,
    but is an important Git operation.
$ git branch -d [branch-name]
    Deletes the specified branch

Create repositories  リポジトリを作成する

When starting out with a new repository, you only need to do it once; either locally, then push to GitHub, or by cloning an existing repository.
新しいリポジトリを始めるときは、ローカルで一度行うか、既存のリポジトリをクローンすることで行います。
$ git init
Turn an existing directory into a git repository

$ git clone [url]

Clone (download) a repository that already exists on GitHub, including all of the files, branches, and commits
GitHubに既に存在するリポジトリをクローン(ダウンロード)し、すべてのファイル、ブランチ、およびコミットを含めます。

The .gitignore file  .gitignoreファイル

Sometimes it may be a good idea to exclude files from being tracked with Git. This is typically done in a special file named .gitignore . You can find helpful templates for .gitignore files at github.com/github/gitignore.
Gitで追跡されないファイルを除外することは、時には良いアイデアかもしれません。これは通常、.gitignoreという特別なファイルで行われます。.gitignoreファイルの役立つテンプレートは、github.com/github/gitignoreで見つけることができます。

Synchronize changes  変更を同期する

Synchronize your local repository with the remote repository on GitHub.com
GitHub.comのリモートリポジトリとローカルリポジトリを同期します

$ git fetch

Downloads all history from the remote tracking branches
リモートトラッキングブランチからすべての履歴をダウンロードします

$ git merge
Combines remote tracking branch into current local branch
リモートトラッキングブランチを現在のローカルブランチに統合します

$ git push

Uploads all local branch commits to GitHub
すべてのローカルブランチのコミットをGitHubにアップロードします

$ git pull

Updates your current local working branch with all new commits from the corresponding remote branch on GitHub. git pull is a combination of git fetch and git merge
現在のローカル作業ブランチを、GitHub 上の対応するリモートブランチからのすべての新しいコミットで更新します。git pullはgit fetchとgit mergeの組み合わせです

Make changes  変更を加えます

Browse and inspect the evolution of project files
プロジェクトファイルの進化をブラウズして検査します

$ git log

Lists version history for the current branch
現在のブランチのバージョン履歴をリストします

$ git log --follow [file]

Lists version history for a file, including renames
ファイルのバージョン履歴をリストし、リネームも含めます

$ git diff [first-branch]...[second-branch]
$ git diff [最初のブランチ]...[2 番目のブランチ]

Shows content differences between two branches
2つのブランチ間の内容の違いを表示します

$ git show [commit]
$ git show [コミット]

Outputs metadata and content changes of the specified commit
指定されたコミットのメタデータと内容の変更を出力します

$ git add [file]
$ git add [ファイル]

Snapshots the file in preparation for versioning
バージョン管理の準備のためにファイルのスナップショットを取得します

$ git commit -m "[descriptive message]"
$ git commit -m "[説明的なメッセージ]"

Records file snapshots permanently in version history
ファイルのスナップショットをバージョン履歴に永久に記録します

Redo commits  コミットをやり直す

Erase mistakes and craft replacement history
間違いを消去し、置き換えの履歴を作成します

$ git reset [commit]

Undoes all commits after [commit], preserving changes locally
[commit] の後のすべてのコミットを元に戻し、変更をローカルに保持します

$ git reset --hard [commit]
$ git reset --hard [コミット]

Discards all history and changes back to the specified commit
指定されたコミットに戻るために、すべての履歴と変更を破棄します

CAUTION! Changing history can have nasty side effects. If you need to change commits that exist on GitHub (the remote), proceed with caution. If you need help, reach out at github.community or contact support.
注意!履歴を変更することは、厄介な副作用を引き起こす可能性があります。GitHub(リモート)に存在するコミットを変更する必要がある場合は、注意して進めてください。助けが必要な場合は、github.communityに連絡するか、サポートにお問い合わせください。

GitHub Flow  GitHubフロー

Glossary  用語集

git: an open source, distributed version-control system
git: オープンソースの分散型バージョン管理システム

GitHub: a platform for hosting and collaborating on Git repositories
GitHub: Gitリポジトリのホスティングとコラボレーションのためのプラットフォーム

commit: a Git object, a snapshot of your entire repository compressed into a SHA
コミット: Gitオブジェクト、リポジトリ全体のスナップショットをSHAに圧縮したもの

branch: a lightweight movable pointer to a commit
ブランチ: コミットへの軽量な可動ポインタ

clone: a local version of a repository, including all commits and branches
クローン: リポジトリのローカルバージョン、すべてのコミットとブランチを含む

remote: a common repository on GitHub that all team member use to exchange their changes
リモート: チームメンバーが変更を交換するために使用するGitHub 上の共通リポジトリ

fork: a copy of a repository on GitHub owned by a different user
フォーク: 異なるユーザーが所有するリポジトリのコピー

pull request: a place to compare and discuss the differences introduced on a branch with reviews, comments, integrated tests, and more
プルリクエスト: ブランチで導入された違いを比較し、レビュー、コメント、統合テストなどを通じて議論する場所

HEAD: representing your current working directory, the HEAD pointer can be moved to different branches, tags, or commits when using git checkout
HEAD: 現在の作業ディレクトリを表し、git checkoutを使用する際にHEADポインタを異なるブランチ、タグ、またはコミットに移動できます

GitHub Training  GitHubトレーニング

Want to learn more about using GitHub and Git?
GitHubとGitの使い方についてもっと学びたいですか?

services@github.com
Email the Training Team or visit our web site for learning
トレーニングチームにメールを送るか、学習のために私たちのウェブサイトを訪れてください。

services.github.com event schedules and private class availability.
services.github.comのイベントスケジュールとプライベートクラスの空き状況。