基础使用:
git init 初始化
git status 查看状态
git add . 添加文件,可以单独添加
git commit -m “” 提交并写上注释
git add origin +地址 添加远程仓库地址
git push origin master 推到仓库
git pull origin master 拉取到本地
报错信息:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/.......'
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 pull --rebase origin master将READ.md拉取到本地。
报错: 拉取到本地时出现以下情况
From https://gitee.com/......
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
方法:
是本地有一个READ.md文件,删除之后使用以下命令即可:
git pull --rebase origin master
**报错信息:**使用git pull拉取仓库代码时,报以下错误:
error: The following untracked working tree files would be overwritten by merge:
解决方法:
先删除本地的为添加到仓库的文件,然后在进行拉取:
git clean -d -fx
git pull ......
**报错:**拉取代码到本地后出现以下报错:
Error:(3, 32) java: 程序包org.springframework.boot不存在
解决方法: