git rabase之后,每次都需要rebase

前段时间,代码有的混乱,就用了一次rebase

$ git pull --rebase


$ git commit -m 'xxxxx'

$ git push


然后下一次想要用

$ git pull

这时就出现了

$ git pull
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.


用git status查看当前状态

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add 
  
  
   
   ..." to update what will be committed)
  (use "git checkout -- 
   
   
    
    ..." to discard changes in working directory)

        modified:   webportal/com-iyunxiao-dora-webportal/src/main/resources/spring-config.xml
        modified:   webportal/com-iyunxiao-dora-webportal/src/main/resources/spring-servlet.xml

no changes added to commit (use "git add" and/or "git commit -a")
   
   
  
  

确实有改动过的文件,stash之后,再用pull,是没问题的,

但是不应该可以直接pull的吗?


baidu&google都搜了,没有跟我相同的问题,都是不符合我遇到的情况

折腾了两周时间

前天晚上,还是去看git的官方文档吧


然后就发现了,解决方案

这里就不贴原文了

有兴趣的同学可以自行查看

https://git-scm.com/docs/git-pull#git-pull---rebasefalsetruepreserveinteractive

https://git-scm.com/docs/git-config#git-config-branchautoSetupRebase

https://git-scm.com/docs/git-config#git-config-branchltnamegtrebase

https://git-scm.com/docs/git-config#git-config-pullrebase



https://git-scm.com/docs/git-config#git-config---global

https://git-scm.com/docs/git-config#git-config---system

https://git-scm.com/docs/git-config#git-config---local

最后我采用的是


$ git config -e --golobal

$ git config -e --local

$ git config -e --system

分别修改配置文件里面的,把跟rebase相关的配置项都删除掉


现在就可以愉快地pull了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值