File: git-gud.md | Updated: 11/15/2025
Agent Skills are now available! Learn more about extending Claude's capabilities with Agent Skills .
English
Search...
Ctrl K
Search...
Navigation
Prompt Library
Git gud
Home Developer Guide API Reference Model Context Protocol (MCP) Resources Release Notes
On this page
Copy this prompt into our developer Console to try it for yourself!
| Role | Content | | --- | --- | | User | I have made some changes to my local files and I want to save them in my local Git repository. What Git command should I use? |
To save the changes you’ve made to your local files in your local Git repository, you should use the following Git commands:
git add . or git add <file>
. adds all changes in the current directory and its subdirectories. If you only want to stage specific files, replace . with the file name or path.git commit -m "Your commit message"
-m flag allows you to provide a commit message describing the changes you’ve made. Replace "Your commit message" with a brief, descriptive summary of your changes.For example, if you’ve made changes to a file named example.txt, you would run:
Copy
git add example.txt
git commit -m "Update example.txt with new content"
These commands will save your changes in your local Git repository, creating a new commit with the provided message. You can later push these changes to a remote repository or continue working on your local branch. Remember to run these commands from within your Git repository directory in your terminal or command prompt.
Copy
import anthropic
client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1000,
temperature=0,
messages=[\
{\
"role": "user",\
"content": [\
{\
"type": "text",\
"text": "I have made some changes to my local files and I want to save them in my local Git repository. What Git command should I use?",\
}\
],\
}\
],
)
print(message.content)
Was this page helpful?
YesNo
Assistant
Responses are generated using AI and may contain mistakes.