自動的なバージョン管理


図の1

漫画:ある博士課程の学生が「FINAL.doc」を指導教員に送ったが、どんどん増えていくコメントや修正を何度も直した挙句、「FINAL_rev.22.comments49.correction.10.#@$%何故大学院に入ったのか分からない?.doc」というファイルで終わる。
“notFinal.doc” by Jorge Cham, https://www.phdcomics.com

図の2

A diagram demonstrating how a single document grows as the result of sequential changes

図の3

A diagram with one source document that has been modified in two different ways to produce two different versions of the document

図の4

A diagram that shows the merging of two different document versions into one document that contains all of the changes from both versions

Gitの設定


リポジトリの作成


図の1

The main elements of the story: Dracula, Wolfman, the Mummy, Mars, Pluto and The MoonWerewolf vs dracula by b-maze / Deviant Art. 火星 by European Space Agency / CC-BY-SA 3.0 IGO. 冥王星 / Courtesy NASA/JPL-Caltech. ミイラ © Gilad Fried / The Noun Project / CC BY 3.0. © Luc Viatour / https://lucnix.be / CC BY-SA 3.0.


変更内容の記録


図の1

A diagram showing how "git add" registers changes in the staging area, while "git commit" moves changes from the staging area to the repository

図の2

A diagram showing two documents being separately staged using git add, before being combined into one commit using git commit

履歴の探索


図の1

以下の図は、git restoreを使って2つのファイルの前のバージョンを復元する方法を示しています

図の2

以下の図は、Gitの全体的なワークフローを示しています。ローカルでの変更は、git addを使ってステージングされ、git commitでローカルリポジトリに反映されます。また、git checkoutを使用することで、リポジトリから変更を元に戻すことができます。

ファイルを無視する


GitHub におけるリモート


図の1

The first step in creating a repository on GitHub: clicking the "create new" button

図の2

The second step in creating a repository on GitHub: filling out the new repository form to provide the repository name, and specify that neither a readme nor a license should be created

図の3

The summary page displayed by GitHub after a new repository has been created. It contains instructions for configuring the new GitHub repository as a git remote

図の4

A diagram showing how "git add" registers changes in the staging area, while "git commit" moves changes from the staging area to the repository

図の5

A diagram illustrating how the GitHub "planets" repository is also a git repository like our local repository, but that it is currently empty

図の6

Clicking the "Copy to Clipboard" button on GitHub to obtain the repository's URL

図の7

A screenshot showing that clicking on "SSH" will make GitHub provide the SSH URL for a repository instead of the HTTPS URL

図の8

A diagram showing how "git push origin" will push changes from the local repository to the remote, making the remote repository an exact copy of the local repository.

Collaborating


図の1

A screenshot of the GitHub Collaborators settings page, which is accessed by clicking "Settings" then "Collaborators"

図の2

A diagram showing that "git clone" can create a copy of a remote GitHub repository, allowing a second person to create their own local repository that they can make changes to.

Conflicts


図の1

A diagram showing a conflict that might occur when two sets of independent changes are merged

オープン サイエンス


Licensing


Citation


Hosting


Supplemental: Using Git from RStudio


図の1

RStudio screenshot showing the file menu dropdown with "New Project..." selected

図の2

RStudio screenshot showing New Project dialog window with "Create project from existing directory" selected

図の3

RStudio window showing the "Create Project From Existing Directory" dialog. In the dialog, the project working directory has been set to "~/Desktop/planets"

図の4

RStudio window after new project is created with large arrow pointing to vertical Git menu bar.

図の5

RStudio window demonstrating the use of the editor panel to modify the "pluto.txt" file

図の6

RStudio screenshot showing the Git menu dropdown with the "Commit..." option selected

図の7

RStudio screenshow showing the "Review Changes" dialog. The top left panel shows the list of files that can be included or excluded from the commit. The top right panel is for writing a commit message. The bottom panel shows information about the currently selected file in the top left panel.

図の8

RStudio screenshot showing the git menu dropdown with the "History" option selected

図の9

RStudio screenshot showing the "Review Changes" dialog after pressing the "History" button. The top panel lists the commits in the repository, similar to git log. The bottom panel shows the changes included in the commit that has been selected in the top panel.

図の10

RStudio screenshot showing .gitignore open in the editor pane with the files .Rproj.user, .Rhistory, .RData, and *.Rproj added to the end