git
is a software tool that allows authors to track file changes inside of a folder on a computer. This special folder is called a git repository. A git repository is just a folder on a computer (any computer locally or online) PLUS a small amount of meta-data stored in a hidden .git/
folder in that same folder.
MyProject/
├── .git
│ └── // magic lives here ...
├── README.txt
└── src
├── MyClass.cpp
└── MyClass.h
The .git/
folder contains a history of file changes and configuration information that updated and accessed by the git
software tool. Users should avoid manually modifying the contents of the .git/
folder (it's hidden for your protection!).
When the original author decides to share a git repository folder with another user, the new user can freely change the folder's contents. The user might update a chapter in a novel, improve existing source code or add documentation in a new subdirectory. The user can then use various git
software tool commands to save those changes into the .git/
folder of the repository.
git
is then able to intelligently merge
the original author's folder with the collaborator's modified folder, resulting in an updated folder that everyone can continue working on together.
github.com is a place online to keep copies of repositories. You can create repositories or contribute to the repositories of others.
-
The repository (see above).
-
The index is a list of tracked files and folders in a repository.
git
is aware of. Any file can be added to the index. Folders are not added unless there is a file in them. Select files and folders can be excluded using strategically constructed.gitignore
files. -
add
Add files to the current index of tracked files and their changes. An index is a list of the files and folders currently being tracked for changes bygit
. -
commit
-
... to be continued