上传JAVA项目代码到Git仓库(本地版)

来自CloudWiki
58.59.0.117讨论2019年5月28日 (二) 08:05的版本 编写项目代码
跳转至: 导航搜索

准备工作

建立一个本地Git仓库:

客户端

普通Git节点即是客户端

编写项目代码

这里我们用从公网上拉去项目来代替程序员的编程工作

从Gitee拉取solo:

git clone solo.git

更改推送地址

cd solo

移除旧的推送地址,添加新的:

git remote remove origin

git remote add origin git@10.0.0.30:/home/git/solo.git

向代码库提交新版本

提交代码到Git仓库并创建tag:

touch solo.git/a.html

git add .

git config --global user.email "you@example.com"

git config --global user.name "Your Name"


git commit -m “a”

创建标签:

git tag 1.0.0

推送到Git服务器:

git push origin 1.0.0