# Git and Project Hygiene

> Version control for code, prompts and eval sets, plus the habits that keep secrets like API keys out of your repository. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/ai-engineer/git
Last updated: 2026-11-28

Version control for code, prompts and eval sets, plus the habits that keep secrets like API keys out of your repository.

Beginner · about 6 hours · difficulty 1/5

Git is how you keep a history of your work and collaborate. In AI projects it matters even more, because **prompts, eval datasets and configuration are code**: a one-word prompt change can alter behaviour across thousands of requests, and you want to know exactly when and why it changed.

### Essentials

- **Daily workflow**: `git status`, `add`, `commit`, `push`, `pull`, meaningful commit messages.
- **Branches and pull requests**: work on a branch, open a PR, review diffs, merge.
- **.gitignore**: exclude virtual environments, `node_modules`, large model files and datasets.
- **Secrets**: API keys belong in environment variables or a `.env` file that is ignored, never in commits. Leaked model keys get abused within minutes and can run up large bills.
- **Large files**: model weights and big datasets do not belong in normal Git; use Git LFS, object storage or a dataset hub.

### Pitfalls

If you commit a key by accident, deleting it in the next commit is not enough; it is still in history. **Revoke the key immediately** and create a new one.

### Good enough to move on

You can create a repo, work on a feature branch, open a pull request, and your repo contains a `.env.example` but never a real key.

## Key concepts

- **Commit, push, pull**
- **Branches and pull requests**
- **.gitignore and .env files**: Keep keys out of history
- **Resolving merge conflicts**
- **Git LFS for large files**
- **Secret scanning**

## Mini project

Put your Python or TypeScript script from the previous topic in a GitHub repo with a README, a .gitignore, a .env.example, and at least one merged pull request.

## Check yourself

You pushed a commit containing an API key and then deleted it in the next commit. Is the key safe? What must you do?

## Free resources

- [Pro Git book](https://git-scm.com/book/en/v2) (git-scm.com)
- [GitHub Docs: Get started](https://docs.github.com/en/get-started) (GitHub)

Previous: [TypeScript for AI Engineers](https://www.internhack.in/roadmaps/tracks/ai-engineer/typescript) · Next: [HTTP, REST APIs and JSON](https://www.internhack.in/roadmaps/tracks/ai-engineer/http-apis-json)

## More in Engineering Foundations for AI Work

- [Python for AI Engineers](https://www.internhack.in/roadmaps/tracks/ai-engineer/python)
- [TypeScript for AI Engineers](https://www.internhack.in/roadmaps/tracks/ai-engineer/typescript)
- [Git and Project Hygiene](https://www.internhack.in/roadmaps/tracks/ai-engineer/git)
- [HTTP, REST APIs and JSON](https://www.internhack.in/roadmaps/tracks/ai-engineer/http-apis-json)
- [Async I/O and Concurrency](https://www.internhack.in/roadmaps/tracks/ai-engineer/async-programming)
- [SQL and Postgres Basics](https://www.internhack.in/roadmaps/tracks/ai-engineer/sql-basics)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [AI Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/ai-engineer)
