burpow
git使用示例

git使用示例

  1. 创建本地项目仓库
1
git clone <url>
1
git init # 在任意文件夹中创建.git

然后
找到 git-bash.exe

1
D:\Python27\Tools\GitHack-master\Git\git-bash.exe

1
cd C:/Users/Administrator/爆米花苞の小窝/.deploy_git/.git
  1. 修改文件内容
  2. git add -m "备注"
    git commit
    git log [--stat]
    git diff <commit id>
  3. 回溯:git reset --hard <commit id>git checkout <commit id>
  4. 分支:git branch
    git checkout -b (develop)
    git checkout (master)
    (干上执行) git merge (develop)

具体 git 源代码管理应用(详见与 DeepSeek 对话)

AI 写好源代码(有 gitignore)

1
git init # 标签U
1
git add .# 标签A(添加到暂存区)
1
git commit -m "备注" # 提交
1
git remote add origin https://github.com/youthfullnesszxx/<project> # 关联远程仓库

1
git remote set-url origin git@github.com:youthfulnesszxx/<project>.git
1
git config core.sshCommand "ssh -i ~/.ssh/<privatekey> -o IdentitiseOnly=yes" # 指定私钥文件
1
git push -u origin main # 初次提交
1
git push # 后续提交

也可以依靠 VScode 中的源代码管理标签

隐藏
换装
本文作者:burpow
本文链接:https://youthfulnesszxx.github.io/2026/05/06/git/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可