1.选择目录
进入本地需要关联的目录(比如demo目录),然后
```
git init
```
2.关联,origin后面的git地址从git远程复制
git remote add origin url地址
3.更新
git pull
如果出现出现
xu:QProj xiaokai$ git push origin master
To https://gitee.com/XXXXX.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/XXXXX.git'
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.
1.把git上的内容更新到本地
git fetch
2.合并修改的内容
git merge
可能会报错
xu:QProj xiaokai$ git merge
fatal: refusing to merge unrelated histories
使用这个命令处理
git pull origin master --allow-unrelated-histories
处理好后继续合并
git merge
出现使用git add .和git commit -m “备注”
fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you merge.
3.合并后更新
git pull
4.最后使用git push origin master
git push origin master