网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Git错误总结-创新互联

1、error: failed to push some refs to 'git@github.com:XXXX/XXXX'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
#解决方法:
git pull --rebase origin master
git push origin master
2、Your local changes to the following files would be overwritten by merge
error: Your local changes to the following files would be overwritten by merge:
        protected/config/main.php
Please, commit your changes or stash them before you can merge.
#解决方法:
如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:
git stash
git pull
git stash pop
然后可以使用git diff -w +文件名 来确认代码自动合并的情况.

反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard
git pull
其中git reset是针对版本,如果想针对文件回退本地修改,使用
git checkout HEAD file/to/restore
3、Pull is not possible because you have unmerged files
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm '
as appropriate to mark resolution, or use 'git commit -a'.
#解决方法:
查看冲突文件
1、git status也可以告诉我们冲突的文件; 
Unmerged paths:
  (use "git add ..." to mark resolution)

        both modified:      file
2、手动解决冲突,然后提交更改:
vi file
git add file
git commit -m '解决冲突'
4、CONFLICT (content):Merge conflict in readme.txt
$ git merge feature1
Auto-merging readme.txt
CONFLICT (content):Merge conflict in readme.txt
Automatic merge failed; fix conflicts andthen commit the result.
#解决方法:
1、git status也可以告诉我们冲突的文件;
#       both modified:      readme.txt  #冲突文件为readme.txt
2、查看readme.txt的内容:
<<<<<<>>>>>> feature1
Git用<<<<<<<,=======,>>>>>>>标记出不同分支的内容,我们修改如下后保存:
master and fenzhi
3、再提交:
$ git add readme.txt 
$ git commit -m "hebing"
5、The branch 'feature-vulcan' is not fully merged.
error:The branch 'feature-vulcan' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feature-vulcan'.
#解决方法:
强行删除,需要使用命令:
git branch -D feature-vulcan。
6、Please move or remove them before you can merge.  Aborting
#解决方法:
git clean  -d  -fx ""
其中 
x  -----删除忽略文件已经对git来说不识别的文件
d  -----删除未被添加到git的路径中的文件
f  -----强制运行

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

从事BGP机房服务器托管,服务器租用,云主机,网站空间域名注册,CDN,网络代维等服务。
文章名称:Git错误总结-创新互联
转载来源:http://bjjierui.cn/article/gshdh.html

其他资讯