...

/

Version Control with GitHub and Gemini CLI

Version Control with GitHub and Gemini CLI

Learn how to manage a complete Git workflow with Gemini CLI, from initializing a local repository to committing and pushing code to GitHub.

We’ve now built, debugged, and refactored a working Flask application. The next step is to save our work professionally using version control. Instead of running Git commands manually, we’ll ask Gemini to handle the workflow: initializing a repository, staging our files, and generating a clear, conventional commit message based on our changes.

Press + to interact

Initializing the repository

Our project currently exists only on our local filesystem. The first step is to place it under version control by creating a new Git repository. The Gemini CLI can interact directly with Git through its shell command execution feature, allowing us to manage our repository using natural language. We will start with a simple, high-level command to Gemini.

Prompt: Initialize a new Git repository in this project directory.

Press + to interact
Initializing the Git repository
Initializing the Git repository

The agent correctly interpreted our high-level goal and executed the git init command to place our project under version control. Our directory is now a fully functional Git repository, establishing the foundation needed to track and save our work.

Checking the project status

With the repository initialized, the next step is to check which files Git is tracking. This quick check confirms that everything is set up correctly and shows us the current state of the project. Let’s ask Gemini to report the repository status.

Prompt: Check the status of our Git repository.

Press + to interact
Response page 1
1 / 2
Response page 1

The agent successfully executed git status, confirming that none of our source files are being tracked yet. Crucially, this output also reveals that temporary files like __pycache__ and our live database bug_tracker.db are ...