Git常见问题怎么解决?

191 阅读1分钟

问题1

问题描述:
Can't Update
No tracked branch configured for branch master or the branch doesn't exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to=origin/master master

解决方案:
git branch --set-upstream-to=origin/master

问题2

问题描述:
Can't Update
fatal: refusing to merge unrelated histories

解决方案:
方案1:允许不相关历史提交,并强制合并
git pull origin master --allow-unrelated-histories
方案2:强制提交
git push --force origin master