Files
BiJi/git/git流程..md
2025-11-27 15:53:29 +08:00

33 lines
872 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
配置用户信息
# 全局配置(所有项目生效)
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 <url>
3. 创建新分支并且切换到新分支
1. git ckeckout -b <name>
4. 添加所有文件
1. git add .
5. 添加提交说明
1. git commit -m "Commit message"
6. 提交到仓库
1. git push origin <name>
2. git push origin main # 推送本地 main 分支到远程 origin
3. git push -u origin feature/login # 第一次推送时设置上游分支(后续可用 git push 直接推送)
git操作指令看清楚了在操作数据不易乱操作导致数据丢失