1.Please specify which branch you want to merge with.
使用git pull的时候多次碰见下面的情况:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> release
使用git在本地新建一个分支后,需要做远程分支关联。如果没有关联,git会在下面的操作中提示你显示的添加关联。
关联目的是在执行git pull, git push操作时就不需要指定对应的远程分支,你只要没有显示指定,git pull的时候,就会提示你。
解决方案:
git branch --set-upstream-to=origin/remote_branch your_branch
//remote_branch用远程仓库的分支替换,your_branch用你自己本地仓库的分支替换
//git branch --set-upstream不再适用了,要用git branch --set-upstream-to
2. fatal: refusing to merge unrelated histories
问题1建立了关联后,merge、pull和push的时候会碰到,这是因为两个分支还没有关联的历史记录,因此需要加一句unrelated histories
解决方案:
git merge main--allow-unrelated-histories
//或者 git pull origin main --allow-unrelated-histories
//哦对了,差点被别人的误导了,现在2023年基本都是main,没有叫master(主人)的了
//Spurred by the rise in racism cases across the US, GitHub recently renamed its 'master' branch to 'main'.
其他常见问题和解决方案:
1.在 Markdown 中插入图片
https://www.jianshu.com/p/ad61a4535767
2.使用Github+picGo搭建图床
https://zhuanlan.zhihu.com/p/489236769
3.Git LFS
//跳过smudge
git lfs install --skip-smudge
git clone ...
// 取二进制文件
git lfs pull
// 恢复smudge
git lfs install --force