1、在gitlab上创建仓库
2、在本地搭建项目框架
3、git init //初始化本地仓库
4、git add . //首次添加变动到本地暂存区
git commit -m "first push" //首次提交本地暂存区文件到本地仓库区
5、git remote add <remote-name> <remote-url> //添加远程仓库地址到本地仓库
6、git fetch <remote-name> //下载远程仓库所有变动
7、git branch -a //查看本地和远程所有分支
8、git branch --track <branch> <remote-branch> //建立本地仓库分支并与远程仓库分支建立一一对应关系
9、git branch -vv //查看所有分支以及追踪关系
10、git push -f <remote> --all //强行推送所有分支所有文件到远程仓库所有分支
11、git pull <remote-name> master --allow-unrelated-histories //合并两个独立启动的仓库的历史
来源:CSDN
作者:糯米控
链接:https://blog.csdn.net/weixin_42338584/article/details/103566858