> For the complete documentation index, see [llms.txt](https://softstack-factory.gitbook.io/mean-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://softstack-factory.gitbook.io/mean-stack/web-and-javascript-fundamentals/wk1/lets-git-it.md).

# Let's Git it!

Section covering version control systems, github and basic git commands

## Objective:

1. Learn about the Git versioning control system
2. Practice git commands

### Slides

{% embed url="<https://docs.google.com/presentation/d/1EnKc3-9LXoWjSj2W17VadrN6zpHuf-sOBrUiopwJAlA/edit#slide=id.g3c189e1c95_1_69>" %}
Intro to Git
{% endembed %}

### Quiz

{% embed url="<https://docs.google.com/forms/d/e/1FAIpQLSfiYGSGvbuRcB-7Tkx3OOijSSbwznNFvGQ4JZ-S03af2Q6lIg/viewform>" %}

## Challenge

Follow this walkthrough to learn how to:

* [ ] Create a remote repository on Github
* [ ] Clone a repo to your local environment on C9
* [ ] Push changes from local to your remote repository

{% embed url="<https://docs.google.com/document/d/1yE-k30FQ3eeglYZilFnuoFb7zjB7Y6LK8BUhq9GcEyc/edit#heading=h.kk1966kbedef>" %}

## Useful Git Commands

| add changes                                  | commit changes                  | push to remote         |
| -------------------------------------------- | ------------------------------- | ---------------------- |
| <p>git add \<filename></p><p> or </p>        | git commit -m "example message" | git push origin master |
| <p>git add . </p><p>(to add all changes)</p> |                                 |                        |

{% hint style="info" %}
Use the following command so that whenever you push, you can store your credentials and don't have to type them every single time you push.
{% endhint %}

| store git credentials              |   |
| ---------------------------------- | - |
| git config credential.helper store |   |

{% hint style="warning" %}
Note that nothing will appear, however next time you push and are prompted to enter your credentials they will be stored and you will no longer be prompted for them.
{% endhint %}

Alternatively you can use the following set of commands :

```
git config --global user.name "your username"

git config --global user.password "your password"

git config --global user.email "your email(used for github)"
```
