<commit_before>---
title: Git reset in simple english
date: 2019-12-27 00:00:00 Z
layout: post
tags:
- git
category:
- tech
---

Before getting ahead lets clear these three fundamental things in git.

1. HEAD: It is a symbolic reference pointing to wherever you are in your commit history.

2. Index: The index, also known as the staging area, is the set of files that will become the next commit. It is also the commit that will become HEAD’s parent.

3. Working Copy: This is the term for the current set of files you’re working on in your file system.


![git-working-directory](/static/img/tech/git-reset/git-working-directory.png)

Few more simple concept:

Note:
>  Git branches are just an alias to git sha-commit. In git all things are tracked by sha2 hash. Hashes are long and tedius to use,hence we use some name/pointer and updated those name to new hashes to move ahead.


So normal workflow is like:

1. When you first checkout a branch, HEAD points to the most recent commit in the branch. 
2. The files in the HEAD (they aren’t technically files, they’re blobs but for the purposes of this discussion we can think of them as straight files) match that of the files in the index, and the files checked out in your working copy match HEAD and the index as well.
3. If All 3(index, HEAD, working-copy) are in an equal state _git_ is happy.<commit_msg>fixed time for post<commit_after>---
title: Git reset in simple english
date: 2019-01-05 00:00:00 Z
layout: post
tags:
- git
category:
- tech
---

Before getting ahead lets clear these three fundamental things in git.

1. HEAD: It is a symbolic reference pointing to wherever you are in your commit history.

2. Index: The index, also known as the staging area, is the set of files that will become the next commit. It is also the commit that will become HEAD’s parent.

3. Working Copy: This is the term for the current set of files you’re working on in your file system.


![git-working-directory](/static/img/tech/git-reset/git-working-directory.png)

Few more simple concept:

Note:
>  Git branches are just an alias to git sha-commit. In git all things are tracked by sha2 hash. Hashes are long and tedius to use,hence we use some name/pointer and updated those name to new hashes to move ahead.


So normal workflow is like:

1. When you first checkout a branch, HEAD points to the most recent commit in the branch. 
2. The files in the HEAD (they aren’t technically files, they’re blobs but for the purposes of this discussion we can think of them as straight files) match that of the files in the index, and the files checked out in your working copy match HEAD and the index as well.
3. If All 3(index, HEAD, working-copy) are in an equal state _git_ is happy.
{'fraction_non_alphanumeric': 0.057833089311859445, 'fraction_numerical': 0.016105417276720352, 'mean_word_length': 3.777972027972028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5561139', 'n_tokens_mistral': 791, 'n_tokens_neox': 734, 'n_words': 456}