1
This commit is contained in:
33
git/git流程..md
Normal file
33
git/git流程..md
Normal file
@@ -0,0 +1,33 @@
|
||||
配置用户信息
|
||||
# 全局配置(所有项目生效)
|
||||
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操作指令看清楚了在操作,数据不易乱操作导致数据丢失
|
||||
Reference in New Issue
Block a user