# Let's Git it!

## 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)"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://softstack-factory.gitbook.io/mean-stack/web-and-javascript-fundamentals/wk1/lets-git-it.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
