git使用及问题
1.push遇到问题
解决:这是因为版本冲突,先git push -u origin master -f ,强制push之后可能会造成一些问题,所以需要自己重新再正常push一遍。
2.git pull:强制覆盖本地文件
3.git branch: 查看分支
git checkout -b branch-name:创建branch-name分支并切换到此分支
git checkout branch-name:切换到branch-name分支
4.git pull冲突
解决:先git add -u,然后git commit,最后git pull
5.git merge 分支名 冲突
解决:git status,把没有自动合并的分支手动push(add-commit-push)
6.git checkout
git checkout -b 分支名 新建分支,并切换
git checkout 分支名 切换分支
git branch 查看分支
git branch -d 分支名 删除分支
git branch -D 分支名 强制删除分支
注意不能在自己分支下删除本分支,要先切换到别的分支,再选择其余分支删除
7.The remote end hung up unexpectedly21.00 KiB/s
sha1 file '<stdout>' write error: Broken pipes
The remote end hung up unexpectedly
解决:可能是因为网速或者文件太大的原因上传太慢导致上传失败,翻个墙或者重新试一下就可以了