Basics Git

Working with Git – a short summary

Many people have asked me repeating questions about git. I have compiled a very brief post that sums up the answers:

Git data transport cf. Oliver Steele
Git data transport (cf. Oliver Steele)

Your local repository consists of three “trees” maintained by git. The first one is your Working Directory which holds the actual files. The second one is the Index which acts as a staging area and finally the HEAD which points to the last commit you’ve made.

Index and Add

The “index” holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working tree, and before running the commit command, you must use the add command to add any new or modified files to the index.

Pushing changes

After committing, your changes are in the HEAD of your local working copy. To send those changes to your remote repository you need to push them.

1 comment Add New Comment

Leave a Reply

Your email address will not be published. Required fields are marked *