当前位置:   article > 正文

Git常见问题及解决方案_error: cannot rebase: you have unstaged changes. e

error: cannot rebase: you have unstaged changes. error: please commit or sta

1.执行git commit -m "中文"后出现乱码,需要进行如下设置

git config --global i18n.commitencoding utf-8

2.修改项目后提交代码

  1. git add .
  2. git commit -m "最新提交"
  3. #查看状态
  4. git status
  5. git push

2.1 git add .有问题,想撤销,则

  1. #两种情况:
  2. git reset HEAD 如果后面什么都不跟的话 就是上一次add 里面的全部撤销了
  3. git reset HEAD XXX/XXX/XXX.java 就是对某个文件进行撤销了

2.2 git commit后想撤销,但是需要保留git add . 的操作 

git reset --soft HEAD^

2.3 git push 报错,提交不上去

     例如:报错内容如下
     hint: Updates were rejected because the tip of your current branch is behind
     hint: its remote counterpart. Integrate the remote changes (e.g.
     hint: 'git pull ...') before pushing again.
     hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git push -u 
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/703205
推荐阅读
相关标签
  

闽ICP备14008679号