利用git,首次上传项目代码,删除某个文件

创建于:2021.09.15
修改于:2021.09.15

1 在gitee构建项目

参见 链接:

2 下载gitee代码

git clone https://gitee.com/user_name/tsp_product.git

3 省略部分文件

.gitignore文件中写入不上传的文件

/data/*
/src/model/*
/src/log/*
/src/pictures/*

/alg.egg-info/*
/build/*
/dist/*

4 上传新增代码模块

在项目主目录下,右击,选择git bash here,进入git 终端。

git init
git add .

git config --global user.email "email_a@163.com"
git config --global user.name "name_a"

git commit -m "First commit tsp prodcut

git push origin master

5 删除某个文件

进入本地仓库:

# 本地同步远程仓库,将远程仓库里的内容拉下来
git pull origin master

# 删除文件
git rm -r --cached 文件名

# 提交并添加说明
git commit -m “delete dir# 将本次更改更新到github项目上去
git push origin master

6 参考链接

7 备用

7.1 Configure Git for the first time

git config --global user.name "你的名字"
git config --global user.email "XX@YY.com.cn"

7.2 just clone this repository

If you want to simply clone this empty repository then run this command in your terminal.

git clone http://YY.com.cn/scm/~user_name/test.git

7.3 My code is ready to be pushed

If you already have code ready to be pushed to this repository then run this in your terminal.

cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin http://YY.com.cn/scm/~user_name/test.git
git push -u origin HEAD:master

7.4 My code is already tracked by Git

If your code is already tracked by Git then set this repository as your “origin” to push to.

cd existing-project
git remote set-url origin http://YY.com.cn/scm/~user_name/test.git
git push -u origin --all
git push origin --tags
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值