<commit_before>---
layout: post
title: Userful Cmd About Git
disqus: y
share: y
---

Some useful commands about git, keep updating:


There are 3 levels of git config; project, global and system.[Stackoverflow](http://stackoverflow.com/questions/8801729/is-it-possible-to-have-different-git-config-for-different-projects)
- project: Project configs are only available for the current project and stored in .git/config in the project's directory.
- global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
- system: System configs are available for all the users/projects and stored in /etc/gitconfig.

Create a project specific config, you have to execute this under the project's directory:
```shell
$ git config user.name "<NAME>" 
```
Create a global config:
```shell
$ git config --global user.name "<NAME>"
```
Create a system config:
```shell
$ git config --system user.name "<NAME>" 
```

For Github, it is using email for user verify
Set your email address with the following command:
```shell
git config --global user.email "<EMAIL>"
```
Confirm that you have set your email address correctly with the following command.
```shell
git config --global user.email
<EMAIL>
```
Set your email address with the following command:
```shell
git config user.email "<EMAIL>"
git config user.email
```










<commit_msg>20170810_155214<commit_after>---
layout: post
title: Userful Cmd About Git
disqus: y
share: y
---

Some useful commands about git, keep updating:


There are 3 levels of git config; project, global and system.[Stackoverflow](http://stackoverflow.com/questions/8801729/is-it-possible-to-have-different-git-config-for-different-projects)
- project: Project configs are only available for the current project and stored in .git/config in the project's directory.
- global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
- system: System configs are available for all the users/projects and stored in /etc/gitconfig.

Create a project specific config, you have to execute this under the project's directory:
```shell
$ git config user.name "<NAME>" 
```
Create a global config:
```shell
$ git config --global user.name "<NAME>"
```
Create a system config:
```shell
$ git config --system user.name "<NAME>" 
```

For Github, it is using email for user verify
Set your email address with the following command:
```shell
git config --global user.email "<EMAIL>"
```
Confirm that you have set your email address correctly with the following command.
```shell
git config --global user.email
<EMAIL>
```
Set your email address with the following command:
```shell
git config user.email "<EMAIL>"
git config user.email
```

IF you computer change password will effect the git password cache, reset it
```shell
git config –global credential.helper unset
```










{'fraction_non_alphanumeric': 0.10205503308951584, 'fraction_numerical': 0.01044932079414838, 'mean_word_length': 4.378277153558052, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3094605', 'n_tokens_mistral': 816, 'n_tokens_neox': 760, 'n_words': 367}