创建组 - 创建用户(Owner),创建项目project,创建分支。
A、将本地项目提交创建到远程主干
1、git clone:本地仓库地址(http://***.***.**:***/user/项目名.git)2、git checkout -b 1.0.0 origin/1.0.0:建立本地和远程分支对应的分支的关联(git checkout -b <branch-name> origin/<branch-name>)
3、将要上传的项目源码等(src文件夹和pom.xml文件)拷贝至此文件夹
4、添加项目到版本库:git add .
5、git commit -m "备注(必填)":git commit告诉Git,把文件提交到仓库
6、git push -u:(-u第一次push时需要的参数,以后直接 git push)本地推送分支
B、从 分支下载项目
1、git clone 本地仓库地址(http://***.***.**:***/user/项目名.git)
2、git checkout -b 1.0.0 origin/1.0.0:建立本地和远程分支对应的分支的关联(git checkout -b <branch-name> origin/<branch-name>)
C、获取最新代码与提交代码
1、建立本地与 个人账户下的远程分支、本地与主干远程下的远程分支的关联
2、从主干远程获取最新代码(git pull http://***.***.**:***/组名/项目名.git 或 通过项目git -> Repositort -> pull 从远程主干获得最新代码,建议不适用这种方式,用->fetch & ->merge)
3、将本地代码提交到 个人账户的远程中(git push http://***.***.**:***/user/项目名.git 或 通过项目git -> Repositort -> push origin/1.0.0 提交到个人账户下远程)
4、将个人账户下的远程 1.0.0 合并到 远程创主干的 1.0.0. OL!
D、删除本地分支 :到项目下的 .git\refs\heads 目录下直接删除
E、本地仓库与远程建立关联:git remote add <name> 远程git仓库地址(https://github.com/用户名/仓库名.git)