# Getting started

## On this page:

1. [Installation & Guide](https://github.com/git-guides/install-git)
2. [General Idea & Basics](/cee-5735/version-control/getting-started-git.md#general-idea-and-basics)
3. [GitHub](/cee-5735/version-control/getting-started-git.md#github-remote-repositories)

## Installation & Guide

Follow the directions here to install git:

{% embed url="<https://github.com/git-guides/install-git>" %}

## General Idea & Basics

Git lets you use branches to test new features/code while keeping a clean record on the main master branch. This functionality is great: if the experimental feature is unsuccessful, it doesn't effect the copy on the master branch; otherwise, if successful, it can be merged back into the master branch.&#x20;

![https://nvie.com/posts/a-successful-git-branching-model/](/files/-MNAYJp7MewOTElqPy4w)

To create a local git repository, run `git init` in the desired directory. To add or update files in the local repo, first use `git add <filename>` to add individual files or  `git add .` to add all files (excluding those in [.gitignore](/cee-5735/version-control/getting-started-git.md#gitignore-file)). This moves the updated files into the staging area and you can check the status using `git status`. Then, commit these changes to the local repo using `git commit -m <message>` and you can check commit history with `git log`.&#x20;

To collaborate, you would want to set up a remote repository on [GitHub](/cee-5735/version-control/getting-started-git.md#github-remote-repositories). To update the files on the remote repo, use `git push`. To update your local repo (*e.g.* when a collaborator has edited something in the remote repo), use `git pull`. Be sure to use `git pull` before `git push`, and if there is a conflict, you may need to merge the code before pushing onto the remote repo.

![https://medium.com/@gagansuneja](/files/-MMr4nm_dfkF-ohr73WH)

### .gitignore file

List the directories and files (e.g. big data files, private info/keys, virtual environment directory, etc.) that you don't want to track with git in a file named *.gitignore*.

## GitHub: Remote Repositories

GitHub is really popular for hosting remote Git repositories. Create an account on GitHub:&#x20;

{% embed url="<https://github.com>" %}


---

# 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://hs764.gitbook.io/cee-5735/version-control/getting-started-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.
