Git常用命令

# 1. 保存你的修改
git stash

# 2. 拉取最新代码(自动尝试合并)
git pull origin main

# 3. 如果有冲突,手动解决后提交
git add .
git commit -m "resolve conflicts"

# 4. 恢复你的修改
git stash pop

# 5. 如果有新冲突,继续解决
git add .
git commit -m "apply my changes"

# 6. 推送
git push origin your-branch

 

git branch # 确认当前分支
git status # 查看冲突状态

posted @ 2025-04-18 09:22  侬侬发  阅读(7)  评论(0)    收藏  举报