1:创建分支并切换到新创建的分支(本地仓库创建分支)
git checkout -b 分支名称
AI 代码解读
2:查看当前分支是从哪个分支创建的
git reflog show --date=iso 分支名称
AI 代码解读
3: 配置邮箱和用户名
git config --global user.email 邮箱
git config --global user.name 名称
AI 代码解读
4:git总是提示输入用户名和密码
git config --global credential.helper store
AI 代码解读
5:本地分支推送到远端
git push origin 分支名称
AI 代码解读
6:远程仓库回退
git log //查看提交记录,查看具体要回到哪个版本
git reset --hard 版本id
git push --force //推到远程
AI 代码解读
7:no next tag(press enter)
使用:q+enter退出
8:删除远程分支(feature-branch远程分支的名称)
git push origin --delete feature-branch
AI 代码解读
9:删除本地分支(feature-branch本地分支名称)
git branch -d feature-branch
AI 代码解读
10: 远程仓库创建的分支本地看不到
git fetch origin
AI 代码解读