git stash暂存工作区修改的内容
git stash list
git stash pop 恢复的就是最新一次stash暂存记录保存在list内,
git stash apply stash@{2} 恢复的指定的stash暂存记录保存在list内,
git stash clear 清空stash
git stash drop stash@{index} 删除某个暂存,
git stash drop stash@`{0`} win10解决
git pull 指令报错
使用git pull 指令时报错:error: You have not concluded your merge (MERGE_HEAD exists)
【问题原因】尚未结束合并merge_HEAD存在
【解决方法】放弃本次merge操作,然后重新pull代码,手动修改冲突代码,合并上传。
git merge --abort // 终止合并
git reset --merge // 重置合并
git pull // 重新拉取代码
git 回滚
执行上面的代码 :git reset --hard c4f43a6,代码会回滚到commitId 所在位置及所在位置之前的所有代码
git reset --hard commit id
git push -f origin <branch>
使用 git log 命令
我们可以使用 git log 命令查看相关信息,展示一个漂亮的提交历史可视化图,包括所有分支的合并和提交信息
git log --graph --oneline --decorate
使用 git reflog 命令
Git reflog 命令可以列出 Git 引用的修改历史,包括 commit、merge、rebase 等。执行命令:
git reflog
有选择的merge
应用环境,在项目上线前,提交到dev分支多个commit ,但个别的可发布的线上,可以有选择的提交commit的节点
git log --oneline
git cherry-pick b7c2befb 3c9063b6