东东
发布于 2024-12-23 / 4 阅读 / 0 评论 / 0 点赞

Github初始化项目仓库

创建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