github船舰新文件夹_新建GitHub项目与删除

一、登录github创建项目 ,步骤如下:

1、点击新建

2、填写仓库名称等

3、创建完成

二、关联已有的本地项目(没有需要关联的本地项目,可以直接从刚刚创建的github仓库clone)

1、到本地项目文件夹下用git命令行依次输入下面的两条命令

git init

ps e:\code> git init

initialized empty git repository in e:/code/.git/

ps e:\code> git remote add origin https://github.com/zhi-nian/vuepractice.git

三、上传自己的本地代码

1、编辑器报错

2、解决办法

切换到项目所在目录,在命令行窗口依次输入

git pull

git pull origin master

git pull origin master --allow-unrelated-histories

执行结果如下:

ps e:\code> git pull

warning: no common commits

remote: enumerating objects: 3, done.

remote: counting objects: 100% (3/3), done.

remote: total 3 (delta 0), reused 0 (delta 0), pack-reused 0

unpacking objects: 100% (3/3), done.

from https://github.com/zhi-nian/vuepractice

* [new branch] master -> origin/master

there is no tracking information for the current branch.

please specify which branch you want to merge with.

see git-pull(1) for details.

git pull

if you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/ master

ps e:\code> git pull origin master

from https://github.com/zhi-nian/vuepractice

* branch master -> fetch_head

fatal: refusing to merge unrelated histories

ps e:\code> git pull origin master --allow-unrelated-histories

from https://github.com/zhi-nian/vuepractice

* branch master -> fetch_head

merge made by the 'recursive' strategy.

readme.md | 2 ++

1 file changed, 2 insertions(+)

create mode 100644 readme.md

完事儿直接用编辑器重新提交代码  ok!

四、代码下拉

1、代码下拉遇到的问题

2、解决办法

切换到项目所在目录,在命令行窗口输入

git branch --set-upstream master origin/master 或 git branch --track master origin/master

执行结果如下:

ps e:\code> git branch --set-upstream master origin/master

the --set-upstream flag is deprecated and will be removed. consider using --track or --set-upstream-to

branch master set up to track remote branch master from origin.

这样就ok了  可以下拉更新了

五、删除项目  步骤如下图

1、

2、

3、

4、完成

希望与广大网友互动??

点此进行留言吧!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值