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