创建github仓库
登录github,创建项目仓库
github提供的方法
第一种,本地没有项目
`第二种,本地有项目
git remote add origin https://github.com/stick2coding/dong-demo.git
git branch -M main
git push -u origin main其他方法
clone到本地
git clone https://github.com/stick2coding/dong-rpc.git新建.gitignore文件
使用idea打开项目文件夹。创建git提交忽略的配置文件。
如果其他项目有对应的文件,也可以复制过来直接使用
这里可以通过安装插件来快速创建
同步云端仓库
其实就是进行一次提交
git add .gitignore
git commit -m "first commit"
如果本地已经有代码,可以尝试和线上仓库进行一次关联后再提交
git remote add origin https://github.com/xxx/xxx.git
git push -u origin master