資源
- Overview
- 快速入門
- Claude 3 模型卡
- Claude 3.7 系統卡
- 系統狀態
- Anthropic 課程
- 提示詞庫
- 提示詞庫
- 宇宙鍵盤
- 企業預見者
- 網站精靈
- Excel 公式專家
- Google Apps 腳本編寫者
- Python 除錯專家
- 時間旅行顧問
- 故事創作夥伴
- 引用您的來源
- SQL 巫師
- 解夢師
- 雙關語大師
- 料理創作者
- 混合詞詩人
- 幽默助手哈爾
- LaTeX 專家
- 情緒色彩轉換器
- Git 精通
- 比喻達人
- 道德困境導航器
- 會議記錄員
- 成語解析器
- 程式碼顧問
- 函數製造者
- 新詞創造者
- CSV 轉換器
- 表情符號編碼器
- 文章潤色師
- 觀點權衡者
- 知識問答生成器
- 正念導師
- 二年級簡化器
- VR 健身創新者
- PII 淨化器
- 備忘錄大師
- 職業顧問
- 評分大師
- 繞口令
- 面試問題設計師
- 文法精靈
- 猜謎遊戲
- 程式碼解釋器
- 外星人類學家
- 資料整理器
- 品牌建構者
- 效率估算器
- 評論分類器
- 方向解碼器
- 激勵繆斯
- 電子郵件提取器
- 專業審核員
- 課程計劃制定者
- 蘇格拉底式智者
- 頭韻煉金術師
- 未來主義時尚顧問
- 多語言超能力
- 產品命名專家
- 哲學沉思
- 電子表格巫師
- 科幻場景模擬器
- 自適應編輯器
- 巴別塔的廣播
- 推文語調偵測器
- 機場代碼分析師
提示詞庫
Git 精通
根據用戶描述的版本控制操作生成適當的 Git 命令。
將此提示複製到我們的開發者控制台中,親自嘗試一下!
角色 | 內容 |
---|---|
User | 我已經對我的本地文件做了一些更改,我想將它們保存在我的本地 Git 倉庫中。我應該使用什麼 Git 命令? |
範例輸出
要將您對本地文件所做的更改保存到本地 Git 倉庫中,您應該使用以下 Git 命令:
-
git add .
或git add <file>
- 此命令暫存您所做的更改,準備提交它們。
.
添加當前目錄及其子目錄中的所有更改。如果您只想暫存特定文件,請將.
替換為文件名或路徑。
- 此命令暫存您所做的更改,準備提交它們。
-
git commit -m "您的提交訊息"
- 此命令將暫存的更改提交到您的本地 Git 倉庫。
-m
標誌允許您提供描述所做更改的提交訊息。將"您的提交訊息"
替換為對您所做更改的簡短描述性摘要。
- 此命令將暫存的更改提交到您的本地 Git 倉庫。
例如,如果您對名為 example.txt
的文件進行了更改,您可以運行:
git add example.txt
git commit -m "使用新內容更新 example.txt"
這些命令將在您的本地 Git 倉庫中保存您的更改,創建一個帶有提供的訊息的新提交。您稍後可以將這些更改推送到遠程倉庫或繼續在本地分支上工作。
請記住,在終端或命令提示符中從 Git 倉庫目錄內運行這些命令。
API 請求
import anthropic
client = anthropic.Anthropic( # 默認為 os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-opus-4-20250514",
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)
import anthropic
client = anthropic.Anthropic( # 默認為 os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-opus-4-20250514",
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)
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
apiKey: "my_api_key", // 默認為 process.env["ANTHROPIC_API_KEY"]
});
const msg = await anthropic.messages.create({
model: "claude-opus-4-20250514",
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?"
}
]
}
]
});
console.log(msg);
from anthropic import AnthropicBedrock
# 查看 https://docs.anthropic.com/claude/reference/claude-on-amazon-bedrock
# 了解認證選項
client = AnthropicBedrock()
message = client.messages.create(
model="anthropic.claude-opus-4-20250514-v1:0",
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)
import AnthropicBedrock from "@anthropic-ai/bedrock-sdk";
// 查看 https://docs.anthropic.com/claude/reference/claude-on-amazon-bedrock
// 了解認證選項
const client = new AnthropicBedrock();
const msg = await client.messages.create({
model: "anthropic.claude-opus-4-20250514-v1:0",
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?"
}
]
}
]
});
console.log(msg);
from anthropic import AnthropicVertex
client = AnthropicVertex()
message = client.messages.create(
model="claude-3-7-sonnet-v1@20250219",
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)
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
// 從 `CLOUD_ML_REGION` 和 `ANTHROPIC_VERTEX_PROJECT_ID` 環境變量讀取。
// 此外還通過標準 `google-auth-library` 流程。
const client = new AnthropicVertex();
const msg = await client.messages.create({
model: "claude-3-7-sonnet-v1@20250219",
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?"
}
]
}
]
});
console.log(msg);