Git全局设置:
git config --global user.name "xxx"
git config --global user.email "xxx"
创建git仓库:
mkdir demo
cd demo
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/xxx/demo.git
git push -u origin "master"
已有仓库?
cd existing_git_repo
git remote add origin https://gitee.com/xxx/demo.git
git push -u origin "master"
在你上传的时候,如果远程仓库中有着本地仓库没有的文件,
及导致本地仓库和远程有不同的开始点,也就是两个仓库没有
共同的 commit 出现的无法提交。
git pull origin master --allow-unrelated-histories
可参考文档
https://blog.csdn.net/m0_63217468/article/details/126667119
Git push命令报hint: Updates were rejected because the remote contains work that you do问题