提交GitHub 完整 Git 命令总结

发布时间:2026/6/28 8:42:53
提交GitHub 完整 Git 命令总结 一、首次从 GitHub 克隆(别人或你自己另一台机器)git clone https://github.com/Trisyp/cnipa-patent-writer.gitcd cnipa-patent-writerWindows PowerShell 克隆到技能目录示例:git clone https://github.com/Trisyp/cnipa-patent-writer.git $env:USERPROFILE\.cursor\skills\cnipa-patent-writer二、本地已有代码,首次关联 GitHub(我们第一次做的)cd C:\Users\admin\.cursor\skills-cursor\cnipa-patent-writer# 初始化仓库git init# 查看状态git status# 添加全部文件git add -A# 首次提交(作者信息可只对本仓库生效,不写 global)git -c user.name="Trisyp" -c user.email="email@qq.com" commit -m "Initial release: CNIPA patent writer skill with Word math support."# 主分支改名为 main(GitHub 默认)git branch -M main# 关联远程仓库git remote add origin http