1、Your branch and ‘origin/yh_branch’ have diverged 2、npm run -s precommit (node v8.9.3) 3、You are currently rebasing branch ‘yh_branch’ on ‘d6e7f13’. ——————————————————————————————— 1、Your branch and ‘origin/yh_branch’ have diverged
huideMacBook-Pro:graph huiyu$ git status
On branch yh_branch
Your branch and ‘origin/yh_branch’ have diverged,
and have 52 and 1 different commits each, respectively.
(use “git pull” to merge the remote branch into yours)
解決步驟:
參考:https://stackoverflow.com/questions/2452226/master-branch-and-origin-master-have-diverged-how-to-undiverge-branches
1、git merge origin/yh_branch(將線上分支merge下來)
2、解決衝突
3、提交 2、npm run -s precommit (node v8.9.3)
huideMacBook-Pro:graph huiyu$ git commit -m “更新代碼”
husky > npm run -s precommit (node v8.9.3)
fatal: Not a git repository: ‘.git’
husky > pre-commit hook failed (add –no-verify to bypass)
解決:
git commit -m “更新代碼” -n 3、You are currently rebasing branch ‘yh_branch’ on ‘d6e7f13’.
問題:
huideMacBook-Pro:graph huiyu$ git status
rebase in progress; onto d6e7f13
You are currently rebasing branch ‘yh_branch’ on ‘d6e7f13’.
(all conflicts fixed: run “git rebase –continue”)
nothing to commit, working tree clean
huideMacBook-Pro:graph huiyu$ git branch
* (no branch, rebasing yh_branch)
解決:
使用【 git diff 】命令,查看有衝突的檔案,【自己解決檔案衝突】或者【使用idea中revert】,當所有衝突解決完畢,最後使用git rebase –continue命令或者git rebase –skip命令。