Files
STM32/git/git流程..md
2025-11-27 09:35:46 +08:00

793 B

配置用户信息 # 全局配置(所有项目生效) git config --global user.name "Your Name" git config --global user.email "your.email@example.com"

# 仅当前项目配置(优先级更高)
git config user.name "Project Name"
  1. 初始化git

    1. git init
  2. 绑定远程仓库链接

    1. git remote add origin
  3. 创建新分支并且切换到新分支

    1. git ckeckout -b
  4. 添加所有文件

    1. git add .
  5. 添加提交说明

    1. git commit -m "Commit message"
  6. 提交到仓库

    1. git push origin
    2. git push origin main # 推送本地 main 分支到远程 origin
    3. git push -u origin feature/login # 第一次推送时设置上游分支(后续可用 git push 直接推送)