# Git

```bash
# To Start a Project use 'git init'
# Project
git init

# To add file or files to staging area on a branch
git add .

# To commit the changes
git commit -m "Message for the log"

# To see the status
git status

# To show all the branches
git branch -a

# To change to a new branch
git checkout {branch name}

# to create a branch named 'dev' and change to it
git checkout -b dev

# To merge a brach. example dev into master
git checkout master
git merge <branch name> 
# where <branch name> is the name of the branch that will be merged into the receiving branch.   

# To see the the commits
git log --oneline
git log --graph --decorate
git log

# To have a look at a past commit - Safe
git checkout {hash}
# To go back to normal origin
git checkout master

# To revert to something in the past - Still safe
git revert {hash}
# then add your message and save and quit

# To reset to a point back in time - Danger, Will Robinson!!!
git reset {hash} --hard
```


---

# 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://squid22.gitbook.io/notes/tools/git.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.
