Git Repository (draft)

This file is best viewed with the TableOfContents chrome-extension.

I wrote this file because I felt confused when I started learning Git. This info is written from a (old!) teacher's perspective.
I am learning Git, so do not expect this guide to be complete.

Definition

Git-repository
is A directory in a computer WITH some files on a subject we are working on AND their history(evolution) MANAGED with the git-program.

Synonyms:
* git-repo.

Content-of-Repo:
The type of information (the subject) stored in the repo's files.

Files-of-Repo:
The repository contains more files than the files we work on.
- "working-files" or "content-files" are the files we work on and contain our subject.

Directories-of-Repo:
- the directory of the repo. The "base" directory|folder.
- the ".git" directory, which holds the history.
- the "working-tree", which is everything else except the .git-dir inside the "base-dir" which holds the content-files IN A SPECIFIC POINT|STAGE IN HISTORY.

Git-Project

Definition:
A set of git-repositories around the net on the same source|content-files.

Synonyms:
Unfortunately, you will find with the same term "git-project" to mean a "git-repository".

Git-Program

Definition:
The Git-program is a distributed version-control-system developed by Linus Torvalds and Junio Hamano mainly used for source-code-managment.

Synonyms:
* git,

WebSite:
* http://git-scm.com/

Git-Instalation

Unix:
* On Ubuntu distribution, you may install Git using the following command
$ sudo apt-get install git-core
* on Fedora distribution, you may install Git using the following command
$ sudo yum install git.

Windows:
* http://code.google.com/p/msysgit/.

Git-Documentation

Official: http://git-scm.com/documentation.

Git-Commands

I present here the basic group of commands.

Git-Repo-Creating-Commands

List:
* git-init = Create repository from an existing directory of working-files
* git-clone = Copy a remote repository
* git-commit = Record changes to the repository.

Git-Versioning-Commands

List:
* git-add = Add files to be included in next commit
* git-commit = Record changes to the repository
* git-status = List files changed since last commit
* git-diff = Find differences between commits etc
* git-reset = Go to previous states
* git-rm = Remove files from the working tree and from the index
* git-mv = Move or rename a file, a directory, or a symlink

Git-Branching-Merging-Commands

List:
* git-branch = List, create, or delete branches
* git-merge = Join two or more development histories together
* git-checkout = Update files in working-tree to match what specified
* git-log = Show history of commits
* git-tag = Give name to commit
* git-stash = Stores all changes in temporary location

Git-Informing-Commands

List:
* git-status = List all files changed since last commit
* git-log = Show the history of commits
* git-diff = Find difference between commits
* git-show = Show various types of objects

Git-Navigating-Commands

List:
* git-checkout = Update files in working-tree to match what specified
* git-tag = Give name to commit
* git-stash = Stores all changes in temporary location

Git-Collaborating-Commands

List:
* git-clone = Copy a remote repository
* git-remote = Manage set of tracked repositories
* git-pull = Fetch from and merge with another repository or a local branch
* git-fetch = Download objects and refs from another repository
* git-push = Update remote refs along with associated objects

Git-Repo-Creating

A user, the first thing he|she wants to do is to create a repo:
* install the Git-program.
* create a repository from an existing directory of working-files with git-init command or
* copy a remote repository with git-clone command.

Commands:

Git-Versioning

Description:
History|time is a continuous entity. Of course Git cannot record the history of our working-files continuously. The USER desides on which discrete point in time the program will store the state|stage of our working-files. The set of all recorded points-in-time is the "history of the repository".

Definition:
* "Commit" they call any recorded stage of our working-files.
Synonyms: "version", "stage", "snapshot".
They call it "commit" from the name of the command they use to do this process.
* "Committing" they call the process of storing a stage in the evolution of working-files.

Warning:
Versioning is NOT an automatic process. The user subjectively decides when to do it, in 3 steps:
1. make changes.
2. record what he|she wants to version. This is called "staging". Repeat [1] and [2] as many times he wants.
3. make changes permanent. This is called "committing".

Commands:

Git-Changing

Description:

Git-Staging

Description:

Git-Committing

Description:

Git-Branching-Merging

Description:
Recording points-in-time of the evolution of our working-files (committing) is the first major feature of the git.
Its second major feature is its capability to create COPIES of our working-files, in parallel with our main working-files in order to experiment with, without destroying our main working-files.

Definition:
* "Branch" they call any copy of our working-files, stored in our repository, PLUS its history.
* "Master-branch" or "master" they call the main working-files.
Git records stages not only of the master-branch but of any branch.

Merging:
Git does not stop on branching. Then it can merge the branches with the master-branch, showing if there are conflicts.

Commands:

Git-Informing

Description:
As our work is developing and growing we must know our branches, our commits, changes after last commit, etc. Git has commands and tools to inform us about all these.

Commands:

Git-Navigating

Description:

Commands:

Git-Collaborating

Description:

General-Senario:
- you will do a number of commits locally,
- then fetch data from the online shared repository you cloned the project from to get up to date,
- merge any new work into the stuff you did,
- then push your changes back up.

Commands:

What-Next

I have tried to give you the big-picture of the Git.
Now you have to learn the SPECIFICS of the commands and of the tools Git uses to do what you want to do.