git本地项目部署

本地项目部署到git

  1. 本地项目根目录 git init ———初始化git仓库 生成 .git文件
  2. 绑定远程仓库

git remote add origin 你的项目地址  比如(https://gitee.com/123456

3. git add . (如果项目大,这里等待时间会有点长)

4. git commit -m '项目部署'

5. 推送:git push -u origin "master"

git status --ignored 查看被忽略的文件
1、重置缓存
git rm -r --cached .             被忽略的所有文件(释放)

2、添加
git add .

3、提交
git commit -m "重置git缓存文件"

常见报错

1.error: remote origin already exists.
这表示你的项目有默认的远程源。
git remote -v  查看远程仓库的信息
git remote rm origin 删除已绑定的仓库
git remote add origin 你的项目地址 再次绑定远程仓库

2. $ git push -u origin "master"
error: src refspec master does not match any
error: failed to push some refs to 'https://gitee.com/123456.git'
未执行git add 导致出错
git add . (如果项目大,这里等待时间会有点长)
git commit -m '项目部署'

3.warning: adding embedded git repository

 当前目录下面有.git文件夹------默认是隐藏的,直接将.git文件夹掉,再重新git add .

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值