git常用命令
配置全局用户名和邮箱:
git config --global user.name “ASxx”
git config --global user.email “123456789@qq.com”
本地已经有项目,cd到当前项目下
git init //git初始化
git remote add origin https://git.oschina.net/name/package.git //与远端仓库建立关联
git push -u origin master //推送代码
报这个错误 git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks merge master
fatal: refusing to merge unrelated histories,
原因:有develop 和master分支,两个分支没有建立起连接
解决方案:强制将历史记录推送到develop 分支
git pull origin develop --allow-unrelated-histories