美文网首页
在github上新建项目

在github上新建项目

作者: lenbolan | 来源:发表于2020-08-13 16:06 被阅读0次

1. 登录github后,点右上角+号,选择New repository

截屏2020-08-13 下午3.36.50.png

2. 在页面中输入项目名、描述,设置为公开或私有项目,以及是否初始化的同时创建README

截屏2020-08-13 下午3.41.31.png

3. 因我本地已经有完整项目,前往本地项目目录,执行

git init

创建本地项目git仓库

4. 添加项目所有文件到本地仓库

git add ./*
git commit -m "Initial commit."

5. 将前面在github上新建的仓库pull下来,执行

git pull https://github.com/youraccount/yourprojectname.git

如果出现 fatal: refusing to merge unrelated histories


截屏2020-08-13 下午4.02.45.png

执行命令

git pull origin master --allow-unrelated-histories

强制合并

6. 添加远程版本库

git remote add origin https://github.com/youraccount/yourprojectname.git

7. 推送到github

git push -u origin master

相关文章

网友评论

      本文标题:在github上新建项目

      本文链接:https://www.haomeiwen.com/subject/vrzbdktx.html