1.执行git commit -m "中文"后出现乱码,需要进行如下设置
git config --global i18n.commitencoding utf-8
2.修改项目后提交代码
git add .
git commit -m "最新提交"
#查看状态
git status
git push
2.1 git add .有问题,想撤销,则
#两种情况:
git reset HEAD 如果后面什么都不跟的话 就是上一次add 里面的全部撤销了
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